Extends
lithium\core\Object
Performs a decrement operation on specified numeric cache item.
Parameters
- string $key Key of numeric cache item to decrement.
- integer $offset Offset to decrement - defaults to 1.
Returns
closure Function returning item's new value on successful decrement, `false` otherwise.Source
public function decrement($key, $offset = 1) {
$cache =& $this->_cache;
return function($self, $params) use (&$cache, $offset) {
extract($params);
return $cache[$key] -= 1;
};
}