ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Psr\SimpleCache\CacheInterface Interface Reference
+ Inheritance diagram for Psr\SimpleCache\CacheInterface:
+ Collaboration diagram for Psr\SimpleCache\CacheInterface:

Public Member Functions

 get ($key, $default=null)
 Fetches a value from the cache. More...
 
 set ($key, $value, $ttl=null)
 Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. More...
 
 delete ($key)
 Delete an item from the cache by its unique key. More...
 
 clear ()
 Wipes clean the entire cache's keys. More...
 
 getMultiple ($keys, $default=null)
 Obtains multiple cache items by their unique keys. More...
 
 setMultiple ($values, $ttl=null)
 Persists a set of key => value pairs in the cache, with an optional TTL. More...
 
 deleteMultiple ($keys)
 Deletes multiple cache items in a single operation. More...
 
 has ($key)
 Determines whether an item is present in the cache. More...
 

Detailed Description

Definition at line 5 of file CacheInterface.php.

Member Function Documentation

◆ clear()

Psr\SimpleCache\CacheInterface::clear ( )

Wipes clean the entire cache's keys.

Returns
bool True on success and false on failure.

Implemented in PhpOffice\PhpSpreadsheet\Collection\Memory.

◆ delete()

Psr\SimpleCache\CacheInterface::delete (   $key)

Delete an item from the cache by its unique key.

Parameters
string$keyThe unique cache key of the item to delete.
Returns
bool True if the item was successfully removed. False if there was an error.
Exceptions

Implemented in PhpOffice\PhpSpreadsheet\Collection\Memory.

◆ deleteMultiple()

Psr\SimpleCache\CacheInterface::deleteMultiple (   $keys)

Deletes multiple cache items in a single operation.

Parameters
iterable$keysA list of string-based keys to be deleted.
Returns
bool True if the items were successfully removed. False if there was an error.
Exceptions

Implemented in PhpOffice\PhpSpreadsheet\Collection\Memory.

◆ get()

Psr\SimpleCache\CacheInterface::get (   $key,
  $default = null 
)

Fetches a value from the cache.

Parameters
string$keyThe unique key of this item in the cache.
mixed$defaultDefault value to return if the key does not exist.
Returns
mixed The value of the item from the cache, or $default in case of cache miss.
Exceptions

Implemented in PhpOffice\PhpSpreadsheet\Collection\Memory.

◆ getMultiple()

Psr\SimpleCache\CacheInterface::getMultiple (   $keys,
  $default = null 
)

Obtains multiple cache items by their unique keys.

Parameters
iterable$keysA list of keys that can obtained in a single operation.
mixed$defaultDefault value to return for keys that do not exist.
Returns
iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value.
Exceptions

Implemented in PhpOffice\PhpSpreadsheet\Collection\Memory.

◆ has()

Psr\SimpleCache\CacheInterface::has (   $key)

Determines whether an item is present in the cache.

NOTE: It is recommended that has() is only to be used for cache warming type purposes and not to be used within your live applications operations for get/set, as this method is subject to a race condition where your has() will return true and immediately after, another script can remove it making the state of your app out of date.

Parameters
string$keyThe cache item key.
Returns
bool
Exceptions

Implemented in PhpOffice\PhpSpreadsheet\Collection\Memory.

◆ set()

Psr\SimpleCache\CacheInterface::set (   $key,
  $value,
  $ttl = null 
)

Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.

Parameters
string$keyThe key of the item to store.
mixed$valueThe value of the item to store, must be serializable.
null | int | \DateInterval$ttlOptional. The TTL value of this item. If no value is sent and the driver supports TTL then the library may set a default value for it or let the driver take care of that.
Returns
bool True on success and false on failure.
Exceptions

Implemented in PhpOffice\PhpSpreadsheet\Collection\Memory.

◆ setMultiple()

Psr\SimpleCache\CacheInterface::setMultiple (   $values,
  $ttl = null 
)

Persists a set of key => value pairs in the cache, with an optional TTL.

Parameters
iterable$valuesA list of key => value pairs for a multiple-set operation.
null | int | \DateInterval$ttlOptional. The TTL value of this item. If no value is sent and the driver supports TTL then the library may set a default value for it or let the driver take care of that.
Returns
bool True on success and false on failure.
Exceptions

Implemented in PhpOffice\PhpSpreadsheet\Collection\Memory.


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