MatthiasMullie\Scrapbook\KeyValueStore::decrement PHP Метод

decrement() публичный Метод

The new counter value will be returned if this operation succeeds, or false for failure (e.g. when the value currently in cache is not a number, in which case it can't be decremented)
public decrement ( string $key, integer $offset = 1, integer $initial, integer $expire ) : integer | boolean
$key string
$offset integer Value to decrement with
$initial integer Initial value (if item doesn't yet exist)
$expire integer Time when item falls out of the cache: 0 = permanent (doesn't expires); under 2592000 (30 days) = relative time, in seconds from now; over 2592000 = absolute time, unix timestamp
Результат integer | boolean New value or false on failure
    public function decrement($key, $offset = 1, $initial = 0, $expire = 0);

Usage Example

Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function decrement($key, $offset = 1, $initial = 0, $expire = 0)
 {
     return $this->cache->decrement($key, $offset, $initial, $expire);
 }