CachePool
class CachePool implements CacheItemPoolInterface (View source)
An implementation of the CacheItemPoolInterface from the PSR-6 specification to be used with our provided backends.
Constants
PATTERN_ENTRYIDENTIFIER |
Pattern an entry identifier must match. |
Properties
protected BackendInterface | $backend | ||
protected string | $identifier | An identifier for this cache, useful if you use several different caches. |
|
protected array | $deferredItems | A list of items still to be persisted. |
Methods
Returns a Cache Item representing the specified key.
Returns a traversable set of cache items.
Confirms if the cache contains specified cache item.
Deletes all items in the pool.
Removes the item from the pool.
Removes multiple items from the pool.
Persists a cache item immediately.
Sets a cache item to be persisted later.
Persists any deferred cache items.
Checks the validity of an entry identifier. Returns true if it's valid.
Details
__construct(string $identifier, BackendInterface $backend)
Constructs the cache
CacheItemInterface
getItem(string $key)
Returns a Cache Item representing the specified key.
array
getItems(array $keys = [])
Returns a traversable set of cache items.
bool
hasItem(string $key)
Confirms if the cache contains specified cache item.
bool
clear()
Deletes all items in the pool.
bool
deleteItem(string $key)
Removes the item from the pool.
bool
deleteItems(array $keys)
Removes multiple items from the pool.
bool
save(CacheItemInterface $item)
Persists a cache item immediately.
bool
saveDeferred(CacheItemInterface $item)
Sets a cache item to be persisted later.
bool
commit()
Persists any deferred cache items.
bool
isValidEntryIdentifier(string $identifier)
Checks the validity of an entry identifier. Returns true if it's valid.