Decrement the numeric data in the cache

@param  string $id
@param  int    $value
@return int | bool
@throws OperationFailed
1586
public function dec($id, $value = 1) {
		if (! $this->connectionCheckStatus) {
			$this->addServer();
		}
		
		$id     = $this->prepareId($id);
		$result = $this->getClient()->decrement($id, $value);
		
		if ($result === false && $this->operationsExceptions) {
			throw new OperationFailed('Decrementing of the data in the cache failed, ID: "' . $id . '"');
		}
		
		return $result;
	}
442541
public function set($id, $data, $lifetime = 0) {
		if (! $this->connectionCheckStatus) {
			$this->addServer();
		}
		
		$id          = $this->prepareId($id);
		$compression = $this->compression ? MEMCACHE_COMPRESSED : 0;
		
		$result = $this->getClient()->set($id, $data, $compression, $lifetime);
		
		if ($result === false && $this->operationsExceptions) {
			throw new OperationFailed('Inserting of the data into the cache failed, ID: "' . $id . '"');
		}
		
		return $result;
	}
871269
private function writeFile($id, $value, $preWriteValueProcessor = null)
    {
        $filePath = $this->getPath($id);
        $dirname = dirname($filePath);
        if (!file_exists($dirname)) {
            mkdir($dirname, self::DEFAULT_MASK, true);
        }

        // we first open with 'c' in case the flock fails
        // 'w' would empty the file that someone else might be working on
        if (false !== ($fp = @fopen($filePath, 'c')) && true === flock($fp, LOCK_EX)) {

            // Runs the pre write callable.
            if (is_callable($preWriteValueProcessor)) {
                $value = call_user_func($preWriteValueProcessor, $id);
            }

            // We first need to truncate.
            ftruncate($fp, 0);
            $string = $this->getContent($id, $value);
            $success = fwrite($fp, $string);
            @flock($fp, LOCK_UN);
            @fclose($fp);
            if ($success) {
                // OPcache workaround
                if (function_exists('opcache_invalidate')) {
                    opcache_invalidate($filePath, true);
                }
            } else {
                common_Logger::w('Could not write '.$filePath);
            }

            return $success !== false;
        } else {
            common_Logger::w('Could not obtain lock on '.$filePath);

            return false;
        }
    }
952330
public function decrement($key, $offset=1, $initial_value=0, $expiry=0) {
		CacheFactory::getCache()->decrement($key, $offset, $initial_value, $expiry);
	}
993421
public function decr($id) {
        $params = [':id' => $id];
        $statement = 'UPDATE kv_store SET kv_value = kv_value - 1 WHERE kv_id = :id';
        return $this->sqlPeristence->exec($statement, $params);
    }
708999
public function decrement($key, $value, \DatePeriod $period = null)
    {
        if (is_null($period)) {
            $this->repository->decrement($key, $value);
        } else {
            $this->decrementForPeriod($key, $value, $period);
        }
    }
958277
public function setDeleteOn($value)
    {
        if (!is_int($value)) {
            throw new JobException('Job setStartOn can sets only integer type!');
        }

        return $this->setData(self::P_DELETE_ON, $value);
    }
393631
public function setPermissionRole(int $id, int $value): void
	{
		if ($this->isAjax()) {
			$acl = $this->orm->acl->getById($id);
			$acl->role = $value;
			$this->orm->persistAndFlush($acl);

			$this->flashNotifier->success('default.dataSaved');

			$this['permissionsList']->redrawItem($id);
		} else {
			$this->terminate();
		}
	}
614282
public function delete($value)
    {
        $id = is_object($value) ? spl_object_hash($value) : $value;
        unset($this->_keys[$id]);
        unset($this->_data[$id]);
        return $this;
    }
26273
public function increment($key, $value = 1)
	{
		return $this->memcache->increment($this->prefix.$key, $value);
	}
585773
public static function doUnaryOperation($operator, &$value)
    {
        if (self::$unaryOperations === null) {
            self::$unaryOperations = [
                    self::BITWISE_NOT   => function (&$i) { return ~$i; },
                    self::NOT           => function (&$i) { return !$i; },
                    self::INCREMENT     => function (&$i) { return $i++; },
                    self::DECREMENT     => function (&$i) { return $i--; },
                    self::PRE_INCREMENT => function (&$i) { return ++$i; },
                    self::PRE_DECREMENT => function (&$i) { return --$i; },
                    self::NEGATION      => function (&$i) { return -$i; },
                    self::PLUS          => function (&$i) { return +$i; },
            ];
        }

        if (!isset(self::$unaryOperations[$operator])) {
            throw new PinqException('Unary operator \'%s\' is not supported', $operator);
        }

        $operation = self::$unaryOperations[$operator];

        return $operation($value);
    }
282994
protected function applyReversedOperation($value, $operator, $operand)
    {
        $processedValue = $value;

        switch ($operator) {
            case "div":
                $processedValue = $processedValue * $operand;
                break;
            case "mul":
                if ($operand !== 0) {
                    $processedValue = $processedValue / $operand;
                }
                break;
            case "add":
                $processedValue = $processedValue - $operand;
                break;
            case "sub":
                $processedValue = $processedValue + $operand;
                break;
            default:
                throw new UnknownOperatorException();
        }

        return $processedValue;
    }
971700
public function decrement($key, $value = 1)
    {
        if ($this->exists($key)) {
            return self::$redis->decrBy($key, $value);
        } else {
            $this->set($key, -$value);

            return -$value;
        }
    }
1269925
public function decrement($key, $value = 1)
    {
        return $this->redisServer->getHashClient($key)->decrBy($key, $value);
    }
220875
public function decr($key, $value = 1) {
        $value = (int) $value;
        try {
            $result = ($value > 1)
                ? $this->getRedis()->decrBy($key, $value)
                : $this->getRedis()->decr($key);
            if ($result !== false) {
                return $result;
            }
            throw new ImpossibleValueException();
        } catch (RedisException $ex) {
            throw new ConnectException();
        }
    }
197660
public function dec($property, $value = 1) {
		if (isset($this->_data[$property])) {
			$this->_data[$property] -= $value;
		} else {
			$this->_data[$property] =- $value;
		}
		
		$this->_changed[$property] = true;
		
		return $this->_data[$property];
	}
968263
public function get($id) {
		try {
			$result = $this->getBackend()->get($this->prepareId($id));
		}
		catch (PhalconCacheException $exception) {
			if ($this->operationsExceptions) {
				throw new OperationFailed('Fetching of the data from the cache failed due to the backend exception occurred: "' . $exception->getMessage() . '"', 0, $exception);
			} else {
				return;
			}
		}
		
		return $result;
	}