CacheInterface
interface CacheInterface (View source)
Interface CacheInterface
Methods
Here we pass in a cache key to be fetched from the cache.
Persisting our data in the cache, uniquely referenced by a key with an optional expiration TTL time.
Remove an item from the cache by its unique key
Fetch data from a callback if item not exists.
Obtain multiple CacheItems by their unique keys
Persisting a set of key => value pairs in the cache, with an optional TTL.
Remove multiple cache items in a single operation
This will wipe out the entire cache's keys
exists
Details
at line line 20
CacheItemInterface
get(string $key)
Here we pass in a cache key to be fetched from the cache.
A CacheItem object will be constructed and returned to us
at line line 32
CacheItemInterface
set(string $key, mixed $val, int|null $ttl = null)
Persisting our data in the cache, uniquely referenced by a key with an optional expiration TTL time.
at line line 41
CacheInterface
remove(string $key)
Remove an item from the cache by its unique key
at line line 52
mixed
call(string $key, callable $callable)
Fetch data from a callback if item not exists.
at line line 62
array
getMultiple(array $keys)
Obtain multiple CacheItems by their unique keys
at line line 74
CacheInterface
setMultiple(array $items)
Persisting a set of key => value pairs in the cache, with an optional TTL.
at line line 83
CacheInterface
removeMultiple(array $keys)
Remove multiple cache items in a single operation
at line line 90
boolean
clear()
This will wipe out the entire cache's keys
at line line 99
bool
exists(string $key)
exists