Elgg
Version 4.3
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
Traits
Cacheable.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Elgg\Traits
;
4
5
use
Elgg\Cache\CompositeCache
;
6
use
ElggCache
;
7
13
trait
Cacheable
{
14
18
protected
$cache;
19
27
public
function
setCache
(
ElggCache
$cache) {
28
$this->cache = $cache;
29
}
30
36
public
function
getCache
() {
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
}
Elgg\Traits\setCache
setCache(ElggCache $cache)
Set cache.
Definition:
Cacheable.php:27
Cacheable
ELGG_CACHE_BLACK_HOLE
const ELGG_CACHE_BLACK_HOLE
Cache init values.
Definition:
constants.php:136
Elgg\Cache\CompositeCache
Composite cache pool.
Definition:
CompositeCache.php:20
CompositeCache
Elgg\Traits\getCache
getCache()
Get cache.
Definition:
Cacheable.php:36
_elgg_services
_elgg_services()
Get the global service provider.
Definition:
elgglib.php:638
Elgg\Traits
Definition:
Cacheable.php:3
ElggCache
Generated on Tue Feb 7 2023 00:00:18 for Elgg by
1.8.11