ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Assetic\Cache\ArrayCache Class Reference

A simple array cache. More...

+ Inheritance diagram for Assetic\Cache\ArrayCache:
+ Collaboration diagram for Assetic\Cache\ArrayCache:

Public Member Functions

 has ($key)
 
 get ($key)
 
 set ($key, $value)
 
 remove ($key)
 

Private Attributes

 $cache = array()
 

Detailed Description

A simple array cache.

Author
Michael Mifsud xzyfe.nosp@m.r@gm.nosp@m.ail.c.nosp@m.om

Definition at line 19 of file ArrayCache.php.

Member Function Documentation

◆ get()

Assetic\Cache\ArrayCache::get (   $key)
See also
CacheInterface::get()

Implements Assetic\Cache\CacheInterface.

Definition at line 34 of file ArrayCache.php.

References Assetic\Cache\ArrayCache\has().

35  {
36  if (!$this->has($key)) {
37  throw new \RuntimeException('There is no cached value for '.$key);
38  }
39 
40  return $this->cache[$key];
41  }
+ Here is the call graph for this function:

◆ has()

Assetic\Cache\ArrayCache::has (   $key)
See also
CacheInterface::has()

Implements Assetic\Cache\CacheInterface.

Definition at line 26 of file ArrayCache.php.

Referenced by Assetic\Cache\ArrayCache\get().

27  {
28  return isset($this->cache[$key]);
29  }
+ Here is the caller graph for this function:

◆ remove()

Assetic\Cache\ArrayCache::remove (   $key)
See also
CacheInterface::remove()

Implements Assetic\Cache\CacheInterface.

Definition at line 54 of file ArrayCache.php.

55  {
56  unset($this->cache[$key]);
57  }

◆ set()

Assetic\Cache\ArrayCache::set (   $key,
  $value 
)
See also
CacheInterface::set()

Implements Assetic\Cache\CacheInterface.

Definition at line 46 of file ArrayCache.php.

47  {
48  $this->cache[$key] = $value;
49  }

Field Documentation

◆ $cache

Assetic\Cache\ArrayCache::$cache = array()
private

Definition at line 21 of file ArrayCache.php.


The documentation for this class was generated from the following file: