Example #1
0
 /**
  * Decrease the cache item.
  *
  * @see http://redis.io/commands/decr
  * @see http://redis.io/commands/decrby
  *
  * @param string $key The cache key
  * @param int $decrement decrement value
  *
  * @return mixed
  */
 public function decrease($key, $decrement = 1)
 {
     $decrement = abs((int) $decrement);
     if ($decrement <= 1) {
         $this->client->decr($key);
     } else {
         $this->client->decrby($key, $decrement);
     }
     return $this;
 }
Example #2
0
 /**
  * {@inheritdoc}
  *
  * @return \Orno\Cache\Adapter\RedisAdapter
  */
 public function decrement($key, $offset = 1)
 {
     $this->redis->decrby($key, $offset);
     return $this;
 }
 /**
  * Decrements an item in the cache.
  *
  * @param string $key
  * @param int $amount
  *
  * @return mixed
  */
 public function decrement(string $key, int $amount = 1)
 {
     $this->predis->decrby($this->prefix . $key, $amount);
 }
Example #4
0
 public function decrementKey($key, $increment)
 {
     return $this->_client->decrby($key, $increment);
 }