Elgg  Version master
Cacheable.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Traits;
4 
7 
13 trait Cacheable {
14 
18  protected $cache;
19 
27  public function setCache(BaseCache $cache): void {
28  $this->cache = $cache;
29  }
30 
36  public function getCache(): BaseCache {
37  if (!isset($this->cache)) {
38  return new CompositeCache('void', _elgg_services()->config, ELGG_CACHE_BLACK_HOLE);
39  }
40 
41  return $this->cache;
42  }
43 }
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
Definition: LICENSE.txt:215
const ELGG_CACHE_BLACK_HOLE
Cache init values.
Definition: constants.php:121
Composite cache pool.
The Elgg cache base class.
Definition: BaseCache.php:9
getCache()
Get cache.
Definition: Cacheable.php:36
_elgg_services()
Get the global service provider.
Definition: elgglib.php:346
setCache(BaseCache $cache)
Set cache.
Definition: Cacheable.php:27