lithium\storage\cache\adapter\Memory::increment()
Implements
lithium\storage\cache\Adapter::increment()
Performs an increment operation on specified numeric cache item.
Parameters
-
string
$key
Key of numeric cache item to increment.
-
integer
$offset
Offset to increment - defaults to
1
.
Returns
integer|booleanThe item's new value on successful increment, else false
.
Source
public function increment($key, $offset = 1) {
if (!array_key_exists($key, $this->_cache)) {
return false;
}
return $this->_cache[$key] += $offset;
}