Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DataPersistor.php
Go to the documentation of this file.
1 <?php
7 
9 
11 {
15  protected $session;
16 
20  public function __construct(
22  ) {
23  $this->session = $session;
24  }
25 
33  public function set($key, $data)
34  {
35  $method = 'set' . ucfirst($key) . 'Data';
36  call_user_func_array([$this->session, $method], [$data]);
37  }
38 
45  public function get($key)
46  {
47  $method = 'get' . ucfirst($key) . 'Data';
48  return call_user_func_array([$this->session, $method], []);
49  }
50 
57  public function clear($key)
58  {
59  $method = 'uns' . ucfirst($key) . 'Data';
60  call_user_func_array([$this->session, $method], []);
61  }
62 }
__construct(SessionManagerInterface $session)
$method
Definition: info.phtml:13