9 abstract class ElggCache implements \ArrayAccess {
26 $this->variables = [];
38 if (!is_array($this->variables)) {
39 $this->variables = [];
42 $this->variables[$variable] =
$value;
53 if (isset($this->variables[$variable])) {
54 return $this->variables[$variable];
102 return $this->
delete(
$key);
114 abstract public function save(
$key,
$data, $expire_after = null);
123 abstract public function load(
$key);
132 abstract public function delete(
$key);
139 abstract public function clear();
147 $this->disabled =
true;
155 $this->disabled =
false;
166 public function populate($values, $expires_after) {
184 if (!isset($this[
$key])) {
230 if (isset($this->
$key)) {
245 return isset($this->
$key);
offsetUnset($key)
Unsets a key.
load($key)
Load data from the cache using a given key.
__construct()
Set the constructor.
__isset($key)
Supporting isset, using $this->load() with default values.
if(elgg_trigger_plugin_hook('usersettings:save', 'user', $hooks_params, true)) foreach($request->validation() ->all() as $item) $data
populate($values, $expires_after)
Populate cache from an array of key => values.
add($key, $data)
Add a key only if it doesn't already exist.
disable()
Disable cache Do not write or read from cache.
__get($key)
Class member get overloading, returning key using $this->load defaults.
offsetExists($key)
Does key exist.
enable()
Enable disabled cache.
offsetGet($key)
Get the value for specified key.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
offsetSet($key, $value)
Assigns a value for the specified key.
__set($key, $value)
Class member set overloading, setting a key using $this->save defaults.
clear()
Clear out all the contents of the cache.
setVariable($variable, $value)
Set a cache variable.
__unset($key)
Supporting unsetting of magic attributes.
getVariable($variable)
Get variables for this cache.
save($key, $data, $expire_after=null)
Save data in a cache.