Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractDecorator.php
Go to the documentation of this file.
1 <?php
8 
13 {
18  protected $_backend;
19 
24  protected $_decoratorOptions = [];
25 
29  public function __construct(array $options = [])
30  {
31  if (array_key_exists(
32  'concrete_backend',
33  $options
34  ) && $options['concrete_backend'] instanceof \Zend_Cache_Backend_Interface
35  ) {
36  $this->_backend = $options['concrete_backend'];
37  unset($options['concrete_backend']);
38  } else {
40  "'concrete_backend' is not specified or it does not implement 'Zend_Cache_Backend_Interface' interface"
41  );
42  }
43  foreach ($options as $optionName => $optionValue) {
44  if (array_key_exists($optionName, $this->_decoratorOptions)) {
45  $this->_decoratorOptions[$optionName] = $optionValue;
46  }
47  }
48  }
49 
56  public function setDirectives($directives)
57  {
58  $this->_backend->setDirectives($directives);
59  }
60 
70  public function load($cacheId, $noTestCacheValidity = false)
71  {
72  return $this->_backend->load($cacheId, $noTestCacheValidity);
73  }
74 
81  public function test($cacheId)
82  {
83  return $this->_backend->test($cacheId);
84  }
85 
101  public function save($data, $cacheId, $tags = [], $specificLifetime = false, $priority = 8)
102  {
103  return $this->_backend->save($data, $cacheId, $tags, $specificLifetime, $priority);
104  }
105 
112  public function remove($cacheId)
113  {
114  return $this->_backend->remove($cacheId);
115  }
116 
134  public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, $tags = [])
135  {
136  return $this->_backend->clean($mode, $tags);
137  }
138 
144  public function getIds()
145  {
146  return $this->_backend->getIds();
147  }
148 
154  public function getTags()
155  {
156  return $this->_backend->getTags();
157  }
158 
167  public function getIdsMatchingTags($tags = [])
168  {
169  return $this->_backend->getIdsMatchingTags($tags);
170  }
171 
180  public function getIdsNotMatchingTags($tags = [])
181  {
182  return $this->_backend->getIdsNotMatchingTags($tags);
183  }
184 
193  public function getIdsMatchingAnyTags($tags = [])
194  {
195  return $this->_backend->getIdsMatchingAnyTags($tags);
196  }
197 
203  public function getFillingPercentage()
204  {
205  return $this->_backend->getFillingPercentage();
206  }
207 
219  public function getMetadatas($cacheId)
220  {
221  return $this->_backend->getMetadatas($cacheId);
222  }
223 
231  public function touch($cacheId, $extraLifetime)
232  {
233  return $this->_backend->touch($cacheId, $extraLifetime);
234  }
235 
250  public function getCapabilities()
251  {
252  return $this->_backend->getCapabilities();
253  }
254 
263  public function setOption($name, $value)
264  {
265  $this->_backend->setOption($name, $value);
266  }
267 
277  public function getLifetime($specificLifetime)
278  {
279  return $this->_backend->getLifetime($specificLifetime);
280  }
281 
290  public function getTmpDir()
291  {
292  return $this->_backend->getTmpDir();
293  }
294 }
$value
Definition: gender.phtml:16
clean($mode=\Zend_Cache::CLEANING_MODE_ALL, $tags=[])
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
Definition: grid.phtml:15
const CLEANING_MODE_ALL
Definition: Cache.php:72
static throwException($msg, Exception $e=null)
Definition: Cache.php:205
save($data, $cacheId, $tags=[], $specificLifetime=false, $priority=8)
if(!isset($_GET['name'])) $name
Definition: log.php:14