Interface CacheEngineInterface
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.
Direct Implementers
Method Summary
- add() publicWrite data for key into a cache engine if it doesn't exist already.
- clearGroup() publicClear all values belonging to the named group.
- decrement() publicDecrement a number under the key and return decremented value
- increment() publicIncrement a number under the key and return incremented value
Method Detail
add()source public
add( string $key , mixed $value )
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
booleanTrue if the data was successfully cached, false on failure. Or if the key existed already.
clearGroup()source public
clearGroup( string $group )
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
booleandecrement()source public
decrement( string $key , integer $offset = 1 )
Decrement a number under the key and return decremented value
Parameters
- string
$key
- Identifier for the data
- integer
$offset
optional 1 - How much to subtract
Returns
boolean|integerNew incremented value, false otherwise
increment()source public
increment( string $key , integer $offset = 1 )
Increment a number under the key and return incremented value
Parameters
- string
$key
- Identifier for the data
- integer
$offset
optional 1 - How much to add
Returns
boolean|integerNew incremented value, false otherwise
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.7/class-Cake.Cache.CacheEngineInterface.html