final class MemoryCacheItemPool implements CacheItemPoolInterface (View source)

Simple in-memory cache implementation.

Methods

CacheItemInterface
getItem($key)

{@inheritdoc}

iterable
getItems(array $keys = [])

{@inheritdoc}

bool
hasItem($key)

{@inheritdoc}

bool
clear()

{@inheritdoc}

bool
deleteItem($key)

{@inheritdoc}

bool
deleteItems(array $keys)

{@inheritdoc}

bool
save(CacheItemInterface $item)

{@inheritdoc}

bool
saveDeferred(CacheItemInterface $item)

{@inheritdoc}

bool
commit()

{@inheritdoc}

Details

CacheItemInterface getItem($key)

{@inheritdoc}

Parameters

$key

Return Value

CacheItemInterface

The corresponding Cache Item.

iterable getItems(array $keys = [])

{@inheritdoc}

Parameters

array $keys

Return Value

iterable

A traversable collection of Cache Items keyed by the cache keys of each item. A Cache item will be returned for each key, even if that key is not found. However, if no keys are specified then an empty traversable MUST be returned instead.

bool hasItem($key)

{@inheritdoc}

Parameters

$key

Return Value

bool

True if item exists in the cache, false otherwise.

bool clear()

{@inheritdoc}

Return Value

bool

True if the pool was successfully cleared. False if there was an error.

bool deleteItem($key)

{@inheritdoc}

Parameters

$key

Return Value

bool

True if the item was successfully removed. False if there was an error.

bool deleteItems(array $keys)

{@inheritdoc}

Parameters

array $keys

Return Value

bool

True if the items were successfully removed. False if there was an error.

bool save(CacheItemInterface $item)

{@inheritdoc}

Parameters

CacheItemInterface $item

Return Value

bool

True if the item was successfully persisted. False if there was an error.

bool saveDeferred(CacheItemInterface $item)

{@inheritdoc}

Parameters

CacheItemInterface $item

Return Value

bool

False if the item could not be queued or if a commit was attempted and failed. True otherwise.

bool commit()

{@inheritdoc}

Return Value

bool

True if all not-yet-saved items were successfully saved or there were none. False otherwise.