Cache
class Cache implements CacheInterface, ArrayAccess (View source)
Class Cache
Methods
Class init.
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
This will wipe out the entire cache's keys
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
Fetch data from a callback if item not exists.
getStorage
setStorage
exists
getHandler
Is a property exists or not.
Get a property.
Set a value to property.
Unset a property.
Details
at line line 45
__construct(CacheItemPoolInterface $storage = null, SerializerInterface $serializer = null)
Class init.
at line line 61
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 83
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 101
CacheInterface
remove(string $key)
Remove an item from the cache by its unique key
at line line 113
boolean
clear()
This will wipe out the entire cache's keys
at line line 126
array
getMultiple(array $keys)
Obtain multiple CacheItems by their unique keys
at line line 140
CacheInterface
setMultiple(array $items, int|null $ttl = null)
Persisting a set of key => value pairs in the cache, with an optional TTL.
at line line 157
CacheInterface
removeMultiple(array $keys)
Remove multiple cache items in a single operation
at line line 173
mixed
call(string $key, callable $callable)
Fetch data from a callback if item not exists.
at line line 201
CacheItemPoolInterface
getStorage()
getStorage
at line line 227
bool
exists(string $key)
exists
at line line 237
SerializerInterface
getSerializer()
getHandler
at line line 249
Cache
setSerializer(SerializerInterface $serializer)
setHandler
at line line 263
boolean
offsetExists(mixed $offset)
Is a property exists or not.
at line line 276
mixed
offsetGet(mixed $offset)
Get a property.
at line line 290
void
offsetSet(mixed $offset, mixed $value)
Set a value to property.
at line line 303
void
offsetUnset(mixed $offset)
Unset a property.