MemoryCacheItemPool
class MemoryCacheItemPool implements CacheItemPoolInterface (View source)
Simple in-memory cache implementation.
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.
Details
at line 41
CacheItemInterface
getItem(string $key)
Returns a Cache Item representing the specified key.
This method must always return a CacheItemInterface object, even in case of a cache miss. It MUST NOT return null.
at line 49
array|Traversable
getItems(array $keys = [])
Returns a traversable set of cache items.
at line 63
bool
hasItem(string $key)
Confirms if the cache contains specified cache item.
Note: This method MAY avoid retrieving the cached value for performance reasons. This could result in a race condition with CacheItemInterface::get(). To avoid such situation use CacheItemInterface::isHit() instead.
at line 73
bool
clear()
Deletes all items in the pool.
at line 84
bool
deleteItem(string $key)
Removes the item from the pool.
at line 92
bool
deleteItems(array $keys)
Removes multiple items from the pool.
at line 106
bool
save(CacheItemInterface $item)
Persists a cache item immediately.
at line 116
bool
saveDeferred(CacheItemInterface $item)
Sets a cache item to be persisted later.
at line 126
bool
commit()
Persists any deferred cache items.