Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Proxy.php
Go to the documentation of this file.
1 <?php
7 
8 use \Magento\Framework\App\CacheInterface;
9 use \Magento\Framework\ObjectManager\NoninterceptableInterface;
10 
14 class Proxy implements
17 {
21  protected $_objectManager;
22 
26  protected $_cache;
27 
32  {
33  $this->_objectManager = $objectManager;
34  }
35 
41  protected function _getCache()
42  {
43  if (null == $this->_cache) {
44  $this->_cache = $this->_objectManager->get(\Magento\Framework\App\Cache::class);
45  }
46  return $this->_cache;
47  }
48 
54  public function getFrontend()
55  {
56  return $this->_getCache()->getFrontend();
57  }
58 
65  public function load($identifier)
66  {
67  return $this->_getCache()->load($identifier);
68  }
69 
79  public function save($data, $identifier, $tags = [], $lifeTime = null)
80  {
81  return $this->_getCache()->save($data, $identifier, $tags, $lifeTime);
82  }
83 
90  public function remove($identifier)
91  {
92  return $this->_getCache()->remove($identifier);
93  }
94 
101  public function clean($tags = [])
102  {
103  return $this->_getCache()->clean($tags);
104  }
105 }
$objectManager
Definition: bootstrap.php:17
__construct(\Magento\Framework\ObjectManagerInterface $objectManager)
Definition: Proxy.php:31
save($data, $identifier, $tags=[], $lifeTime=null)
Definition: Proxy.php:79