43 $this->maximumSize =
$size;
58 return $this->data[
$key];
78 if ($this->
size() > $this->maximumSize) {
81 unset($this->data[key($this->data)]);
92 return count($this->data);
103 return array_key_exists(
$key, $this->data);
116 unset($this->data[
$key]);
141 unset($this->data[
$key]);
154 #[\ReturnTypeWillChange] 167 #[\ReturnTypeWillChange] 180 #[\ReturnTypeWillChange] 193 #[\ReturnTypeWillChange]
offsetUnset($offset)
Unsets a key.
Exception thrown to indicate range errors during program execution.
size()
Get the number of elements in the cache.
Least Recently Used Cache.
offsetExists($offset)
Does key exist?
recordAccess($key)
Moves the element from current position to end of array.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
containsKey($key)
Does the cache contain an element with this key.
offsetGet($offset)
Get the value for specified key.
offsetSet($offset, $value)
Assigns a value for the specified key.
__construct(int $size)
Create a LRU Cache.