Stud.IP  6.0
Cache Class Reference
Inheritance diagram for Cache:
DbCache FileCache MemcachedCache MemoryCache Proxy RedisCache Wrapper

Public Member Functions

 getStats ()
 
 expire ($arg)
 
 flush ()
 
 getItem (string $key)
 
 hasItem (string $key)
 
 read ($arg)
 
 write ($name, $content, $expires=self::DEFAULT_EXPIRATION)
 
 getExpiration (CacheItemInterface $item)
 
 getItems (array $keys=[])
 
 clear ()
 
 deleteItem ($key)
 
 deleteItems (array $keys)
 
 saveDeferred (CacheItemInterface $item)
 
 commit ()
 

Static Public Member Functions

static getDisplayName ()
 
static getConfig ()
 

Data Fields

const DEFAULT_EXPIRATION = 12 * 60 * 60
 

Protected Attributes

array $deferred_items = []
 

Detailed Description

An abstract class which has to be extended by instances returned from #getCache

Author
Marco Diedrich (mdiedric)
Marcus Lunzenauer (mlunz.nosp@m.ena@.nosp@m.uos.d.nosp@m.e)
Moritz Strohm stroh.nosp@m.m@da.nosp@m.ta-qu.nosp@m.est..nosp@m.de
Since
1.6 GPL2 or any later version

Member Function Documentation

◆ clear()

clear ( )
See also
CacheItemPoolInterface::clear

◆ commit()

commit ( )
See also
CacheItemPoolInterface::commit

◆ deleteItem()

deleteItem (   $key)
See also
CacheItemPoolInterface::deleteItem

◆ deleteItems()

deleteItems ( array  $keys)
See also
CacheItemPoolInterface::deleteItems

◆ expire()

expire (   $arg)
abstract

Expire item from the cache.

Example:

expires foo

$cache->expire('foo');

Parameters
string$arga single key

◆ flush()

flush ( )
abstract

Expire all items from the cache.

◆ getConfig()

static getConfig ( )
staticabstract

Return the Vue component name and props that handle configuration. The associative array is of the form [ 'component' => <Vue component="" name>="">, 'props' => <Properties for="" component>=""> ]

Returns
array

◆ getDisplayName()

static getDisplayName ( )
staticabstract
Returns
string A translateable display name for this cache class.

◆ getExpiration()

getExpiration ( CacheItemInterface  $item)

Calculates the expiration by a cache item. If that cannot be determined, the default expiration period is returned.

Parameters
Item$itemThe item from which to get the expiration time.
Returns
int The time from now until the expiration in seconds.

◆ getItem()

getItem ( string  $key)
abstract
See also
CacheItemPoolInterface::getItem

◆ getItems()

getItems ( array  $keys = [])
See also
CacheItemPoolInterface::getItems

◆ getStats()

getStats ( )
abstract

Get some statistics from cache, like number of entries, hit rate or whatever the underlying cache provides. Results are returned in form of an array like "[ [ 'name' => <displayable name>=""> 'value' =>

] ]"

Returns
array

◆ hasItem()

hasItem ( string  $key)
abstract
See also
CacheItemPoolInterface::hasItem

◆ read()

read (   $arg)

Retrieve item from the server.

Example:

reads foo

$foo = $cache->reads('foo');

Parameters
string$arga single key
Returns
mixed the previously stored data if an item with such a key exists on the server or FALSE on failure.

◆ saveDeferred()

saveDeferred ( CacheItemInterface  $item)
See also
CacheItemPoolInterface::saveDeferred

◆ write()

write (   $name,
  $content,
  $expires = self::DEFAULT_EXPIRATION 
)

Store data at the server.

Parameters
string$namethe item's key.
mixed$contentthe item's content (will be serialized if necessary).
int$expiresthe item's expiry time in seconds. Optional, defaults to 12h.
Returns
bool returns TRUE on success or FALSE on failure.

Field Documentation

◆ $deferred_items

array $deferred_items = []
protected

◆ DEFAULT_EXPIRATION

const DEFAULT_EXPIRATION = 12 * 60 * 60

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