Store
abstract class Store implements StoreInterface
Base store.
Properties
protected string|null | $prefix | Prefix. |
Methods
$this
setPrefix(string $prefix)
Sets the cache key prefix.
string|null
getPrefix()
Returns the cache key prefix.
string
getPrefixedKey(string $key)
Returns a prefixed key.
bool
putIfNotExists(string $key, mixed $data, int $ttl = 0)
Store data in the cache if it doesn't already exist.
mixed
getAndPut(string $key, mixed $data, int $ttl = 0)
Fetch data from the cache and replace it.
mixed
getAndRemove(string $key)
Fetch data from the cache and remove it.
mixed
getOrElse(string $key, callable $data, int $ttl = 0)
Fetch data from the cache or store it if it doesn't already exist.
Details
at line 30
$this
setPrefix(string $prefix)
Sets the cache key prefix.
at line 42
string|null
getPrefix()
Returns the cache key prefix.
at line 53
protected string
getPrefixedKey(string $key)
Returns a prefixed key.
at line 61
bool
putIfNotExists(string $key, mixed $data, int $ttl = 0)
Store data in the cache if it doesn't already exist.
at line 79
mixed
getAndPut(string $key, mixed $data, int $ttl = 0)
Fetch data from the cache and replace it.
at line 94
mixed
getAndRemove(string $key)
Fetch data from the cache and remove it.
at line 109
mixed
getOrElse(string $key, callable $data, int $ttl = 0)
Fetch data from the cache or store it if it doesn't already exist.