class UpdateTimestampCache extends DefaultRegion implements TimestampRegion (View source)

Tracks the timestamps of the most recent updates to particular keys.

Constants

REGION_KEY_SEPARATOR

Properties

protected Cache $cache from DefaultRegion
protected string $name from DefaultRegion
protected int $lifetime from DefaultRegion

Methods

__construct($name, Cache $cache, $lifetime = 0)

No description

string
getName()

Retrieve the name of this region.

CacheProvider
getCache()

No description

bool
contains(CacheKey $key)

Determine whether this region contains data for the given key.

CacheEntry|null
get(CacheKey $key)

Get an item from the cache.

CacheEntry[]|null
getMultiple(CollectionCacheEntry $collection)

Get all items from the cache identified by $keys.

string
getCacheEntryKey(CacheKey $key)

No description

put(CacheKey $key, CacheEntry $entry, Lock|null $lock = null)

Put an item into the cache.

evict(CacheKey $key)

Remove an item from the cache.

evictAll()

Remove all contents of this particular cache region.

update(CacheKey $key)

Update an specific key into the cache region.

Details

__construct($name, Cache $cache, $lifetime = 0)

Parameters

$name
Cache $cache
$lifetime

string getName()

Retrieve the name of this region.

Return Value

string The region name

CacheProvider getCache()

Return Value

CacheProvider

bool contains(CacheKey $key)

Determine whether this region contains data for the given key.

Parameters

CacheKey $key The cache key

Return Value

bool TRUE if the underlying cache contains corresponding data; FALSE otherwise.

CacheEntry|null get(CacheKey $key)

Get an item from the cache.

Parameters

CacheKey $key The key of the item to be retrieved.

Return Value

CacheEntry|null The cached entry or NULL

Exceptions

CacheException Indicates a problem accessing the item or region.

CacheEntry[]|null getMultiple(CollectionCacheEntry $collection)

Get all items from the cache identified by $keys.

It returns NULL if some elements can not be found.

Parameters

CollectionCacheEntry $collection The collection of the items to be retrieved.

Return Value

CacheEntry[]|null The cached entries or NULL if one or more entries can not be found

protected string getCacheEntryKey(CacheKey $key)

Parameters

CacheKey $key

Return Value

string

put(CacheKey $key, CacheEntry $entry, Lock|null $lock = null)

Put an item into the cache.

Parameters

CacheKey $key The key under which to cache the item.
CacheEntry $entry The entry to cache.
Lock|null $lock The lock previously obtained.

Exceptions

CacheException Indicates a problem accessing the region.

evict(CacheKey $key)

Remove an item from the cache.

Parameters

CacheKey $key The key under which to cache the item.

Exceptions

CacheException Indicates a problem accessing the region.

evictAll()

Remove all contents of this particular cache region.

Exceptions

CacheException Indicates problem accessing the region.

update(CacheKey $key)

Update an specific key into the cache region.

Parameters

CacheKey $key The key of the item to update the timestamp.

Exceptions

LockException Indicates a problem accessing the region.