HandlebarsCacheDummy

A dummy array cache.

Defined (2)

The class is defined in the following location(s).

/vendor/calderawp/metaplate-core/vendor/xamin/handlebars.php/src/Handlebars/Cache/Dummy.php  
  1. class Dummy implements Cache 
  2. private $_cache = array(); 
  3.  
  4. /** 
  5. * Get cache for $name if exist. 
  6. * @param string $name Cache id 
  7. * @return mixed data on hit, boolean false on cache not found 
  8. */ 
  9. public function get($name) 
  10. if (array_key_exists($name, $this->_cache)) { 
  11. return $this->_cache[$name]; 
  12. return false; 
  13.  
  14. /** 
  15. * Set a cache 
  16. * @param string $name cache id 
  17. * @param mixed $value data to store 
  18. * @return void 
  19. */ 
  20. public function set($name, $value) 
  21. $this->_cache[$name] = $value; 
  22.  
  23. /** 
  24. * Remove cache 
  25. * @param string $name Cache id 
  26. * @return void 
  27. */ 
  28. public function remove($name) 
  29. unset($this->_cache[$name]); 
  30.  
/vendor/xamin/handlebars.php/src/Handlebars/Cache/Dummy.php  
  1. class Dummy implements Cache 
  2. private $_cache = array(); 
  3.  
  4. /** 
  5. * Get cache for $name if exist. 
  6. * @param string $name Cache id 
  7. * @return mixed data on hit, boolean false on cache not found 
  8. */ 
  9. public function get($name) 
  10. if (array_key_exists($name, $this->_cache)) { 
  11. return $this->_cache[$name]; 
  12. return false; 
  13.  
  14. /** 
  15. * Set a cache 
  16. * @param string $name cache id 
  17. * @param mixed $value data to store 
  18. * @return void 
  19. */ 
  20. public function set($name, $value) 
  21. $this->_cache[$name] = $value; 
  22.  
  23. /** 
  24. * Remove cache 
  25. * @param string $name Cache id 
  26. * @return void 
  27. */ 
  28. public function remove($name) 
  29. unset($this->_cache[$name]); 
  30.