\Cake\CacheCacheEngineInterface

Interface for cache engines that defines methods outside of the PSR16 interface that are used by `Cache`.

Internally Cache uses this interface when calling engine methods.

Summary

Methods
Constants
add()
increment()
decrement()
clearGroup()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

add()

add(string  $key, mixed  $value) : boolean

Write data for key into a cache engine if it doesn't exist already.

Parameters

string $key

Identifier for the data.

mixed $value

Data to be cached - anything except a resource.

Returns

boolean —

True if the data was successfully cached, false on failure. Or if the key existed already.

increment()

increment(string  $key, integer  $offset = 1) : boolean|integer

Increment a number under the key and return incremented value

Parameters

string $key

Identifier for the data

integer $offset

How much to add

Returns

boolean|integer —

New incremented value, false otherwise

decrement()

decrement(string  $key, integer  $offset = 1) : boolean|integer

Decrement a number under the key and return decremented value

Parameters

string $key

Identifier for the data

integer $offset

How much to subtract

Returns

boolean|integer —

New incremented value, false otherwise

clearGroup()

clearGroup(string  $group) : boolean

Clear all values belonging to the named group.

Each implementation needs to decide whether actually delete the keys or just augment a group generation value to achieve the same result.

Parameters

string $group

name of the group to be cleared

Returns

boolean