StringCacheAdapter
in package
implements
StringCache
uses
ForbidCloning, ForbidSerialization
Table of Contents
Interfaces
Properties
Methods
- __construct() : mixed
- __serialize() : never
- __unserialize() : never
- delete() : bool|null
- Deletes a value associated with the given key if it exists.
- get() : string|null
- Gets a value associated with the given key.
- set() : void
- Sets a value associated with the given key. Overrides existing values (if they exist).
- __clone() : mixed
Properties
$cache read-only
private
Cache
$cache
Methods
__construct()
public
__construct(Cache $cache) : mixed
Parameters
- $cache : Cache
__serialize()
public
final __serialize() : never
Return values
never__unserialize()
public
final __unserialize(array<string|int, mixed> $data) : never
Parameters
- $data : array<string|int, mixed>
Return values
neverdelete()
Deletes a value associated with the given key if it exists.
public
delete(string $key) : bool|null
Implementations SHOULD return boolean true or false to indicate whether the specified key existed at the time the delete operation was requested. If such information is not available, the implementation MUST return null.
Implementations MUST NOT error for non-existent keys.
Parameters
- $key : string
-
string Cache key.
Return values
bool|null —Returns true / false to indicate whether the key existed, or null if that information is not available.
get()
Gets a value associated with the given key.
public
get(string $key) : string|null
If the specified key doesn't exist implementations MUST return null.
Parameters
- $key : string
-
string Cache key.
Return values
string|null —Returns the cached value, or null if it doesn't exist
set()
Sets a value associated with the given key. Overrides existing values (if they exist).
public
set(string $key, string $value[, int|null $ttl = null ]) : void
TTL values less than 0 MUST throw an \Error.
Parameters
- $key : string
-
string Cache key.
- $value : string
-
string Value to cache.
- $ttl : int|null = null
-
int Timeout in seconds >= 0. The default null $ttl value indicates no timeout.
__clone()
protected
final __clone() : mixed