Documentation

Region extends MultiGetRegion

Defines a contract for accessing a particular named region.

Table of Contents

Methods

contains()  : bool
Determine whether this region contains data for the given key.
evict()  : bool
Remove an item from the cache.
evictAll()  : bool
Remove all contents of this particular cache region.
get()  : CacheEntry|null
Get an item from the cache.
getMultiple()  : array<string|int, CacheEntry>|null
Get all items from the cache identified by $keys.
getName()  : string
Retrieve the name of this region.
put()  : bool
Put an item into the cache.

Methods

contains()

Determine whether this region contains data for the given key.

public contains(CacheKey $key) : bool
Parameters
$key : CacheKey

The cache key

Return values
bool

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

evict()

Remove an item from the cache.

public evict(CacheKey $key) : bool
Parameters
$key : CacheKey

The key under which to cache the item.

Tags
throws
CacheException

Indicates a problem accessing the region.

Return values
bool

evictAll()

Remove all contents of this particular cache region.

public evictAll() : bool
Tags
throws
CacheException

Indicates problem accessing the region.

Return values
bool

getMultiple()

Get all items from the cache identified by $keys.

public getMultiple(CollectionCacheEntry $collection) : array<string|int, CacheEntry>|null

It returns NULL if some elements can not be found.

Parameters
$collection : CollectionCacheEntry

The collection of the items to be retrieved.

Return values
array<string|int, CacheEntry>|null

The cached entries or NULL if one or more entries can not be found

getName()

Retrieve the name of this region.

public getName() : string
Return values
string

The region name

put()

Put an item into the cache.

public put(CacheKey $key, CacheEntry $entry[, Lock|null $lock = null ]) : bool
Parameters
$key : CacheKey

The key under which to cache the item.

$entry : CacheEntry

The entry to cache.

$lock : Lock|null = null

The lock previously obtained.

Tags
throws
CacheException

Indicates a problem accessing the region.

Return values
bool

        
On this page

Search results