load a deny if rule into the store
ie.
$ruleStore->addDenyIfRule('status', Invoices::ST_BILLED, '=', DELETERULES);

@param $field
@param $value
@param string $operator
@param int $crud
162703
public function addDenyIfRule($field, $value, $operator = '==', $crud = DELETERULES)
    {
        // if an existing rule is detected, over write
        $this->rules[rand(1, 99999)] = new DenyIfRule($field, $value, $operator, $crud);
    }
442280
public function inc($id, $value = 1) {
		if (! $this->connectionCheckStatus) {
			$this->addServer();
		}
		
		$id     = $this->prepareId($id);
		$result = $this->getClient()->increment($id, $value);
		
		if ($result === false && $this->operationsExceptions) {
			throw new OperationFailed('Incrementing of the data in the cache failed, ID: "' . $id . '"');
		}
		
		return $result;
	}
1315320
protected function getCorrectValue($operator, $rule, $value)
    {
        $requireArray = $this->operatorRequiresArray($operator);

        return $this->enforceArrayOrString($requireArray, $value, $rule->field);
    }
402054
public function loadBy($field, $cond = UNDEFINED, $value = UNDEFINED)
    {
        $q = $this->dsql;
        $this->dsql = $this->dsql();
        $this->addCondition($field, $cond, $value);
        $this->loadAny();
        $this->dsql = $q;

        return $this;
    }
466938
public function iFillInSelect2Field($field, $value)
    {
        $page = $this->getSession()->getPage();

        $this->openField($page, $field);
        $this->selectValue($page, $field, $value, $this->timeout);
    }
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;
	}
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);
    }
1289548
protected function verifyNegativeField($field, $value)
    {
        if (!empty($value) && $value > 0) {
            throw new \Genesis\Exceptions\ErrorParameter(
                sprintf(
                    'Item parameter %s is set to %s, but expected to be negative number',
                    $field,
                    $value
                )
            );
        }
    }
1164615
public function validate($field, $value, $validator) {

		if(empty($value)) return false;
		if(!filter_var($value, FILTER_VALIDATE_URL)) return false;

		$url = parse_url($value);
		if(!in_array($url['scheme'], $this->allowed_protocols)) return false;

		if($this->allowed_domains === null) return true;

		return in_array($url['host'], $this->allowed_domains);

	}
1018801
public function bind($param, $value, $type = null)
    {
        if (is_null($type)) {
            switch (true) {
                case is_int($value):
                    $type = PDO::PARAM_INT;
                    break;
                case is_bool($value):
                    $type = PDO::PARAM_BOOL;
                    break;
                case is_null($value):
                    $type = PDO::PARAM_NULL;
                    break;
                default:
                    $type = PDO::PARAM_STR;
            }
        }
        //then run PDO bindValue on the statement to bind the values
        self::$statement->bindValue($param, $value, $type);
    }
749964
public function where($field, $operator, $value = null)
    {
        if (is_null($value)) {
            $value    = $operator;
            $operator = '=';
        }

        return $this->filter(function ($data) use ($field, $operator, $value) {
            if (strpos($field, '.')) {
                list($field, $relation) = explode('.', $field);

                $result = isset($data[$field][$relation]) ? $data[$field][$relation] : null;
            } else {
                $result = isset($data[$field]) ? $data[$field] : null;
            }

            switch ($operator) {
                case '===':
                    return $result === $value;
                case '!==':
                    return $result !== $value;
                case '!=':
                case '<>':
                    return $result != $value;
                case '>':
                    return $result > $value;
                case '>=':
                    return $result >= $value;
                case '<':
                    return $result < $value;
                case '<=':
                    return $result <= $value;
                case 'like':
                    return is_string($result) && false !== strpos($result, $value);
                case 'not like':
                    return is_string($result) && false === strpos($result, $value);
                case 'in':
                    return is_scalar($result) && in_array($result, $value, true);
                case 'not in':
                    return is_scalar($result) && !in_array($result, $value, true);
                case 'between':
                    list($min, $max) = is_string($value) ? explode(',', $value) : $value;
                    return is_scalar($result) && $result >= $min && $result <= $max;
                case 'not between':
                    list($min, $max) = is_string($value) ? explode(',', $value) : $value;
                    return is_scalar($result) && $result > $max || $result < $min;
                case '==':
                case '=':
                default:
                    return $result == $value;
            }
        });
    }
303604
protected function invalidOperatorAndValue($operator, $value)
    {
        return is_null($value) && array_key_exists($operator, $this->operators) &&
        ! array_key_exists($operator, ['=', '<>', '!=']);
    }
956123
protected function requireIf($value, $rule, $data)
    {
        list($field, $val)=explode(',', $rule);
        if ($this->getDataValue($data, $field) == $val) {
            return !empty($value);
        } else {
            return true;
        }
    }
1090323
public function inc($id, $value = 1) {
		$id      = $this->prepareId($id);
		$backend = $this->getBackend();
		
		// Get the counter
		try {
			$result = $backend->get($id);
		}
		catch (PhalconCacheException $exception) {
			if ($this->operationsExceptions) {
				throw new OperationFailed('Incrementing (get) of the data in the cache failed due to the backend exception occurred: "' . $exception->getMessage() . '"', 0, $exception);
			} else {
				return false;
			}
		}
		
		if ($result === null) {
			if ($this->operationsExceptions) {
				throw new OperationFailed('Incrementing (get) of the data in the cache failed, ID: "' . $id . '"');
			} else {
				return false;
			}
		}
		
		// Set the counter
		$newValue = $result + $value;
		
		try {
			$saveResult = $backend->save($id, $newValue);
		}
		catch (PhalconCacheException $exception) {
			if ($this->operationsExceptions) {
				throw new OperationFailed('Incrementing (set) of the data in the cache failed due to the backend exception occurred: "' . $exception->getMessage() . '"', 0, $exception);
			} else {
				return false;
			}
		}
		
		if ($saveResult === false) {
			if ($this->operationsExceptions) {
				throw new OperationFailed('Incrementing (set) of the data in the cache failed, ID: "' . $id . '"');
			} else {
				return false;
			}
		}
		
		return $newValue;
	}
1265245
public function acceptsValue($value): bool {
		switch ($this->operator) {
			case CriteriaComparator::OPERATOR_NOT_IN:
				if ($value === null) return true;
				return !$this->in($value);
			case CriteriaComparator::OPERATOR_IN:
				if ($value === null) return false;
				return !$this->in($value);
				
			case CriteriaComparator::OPERATOR_CONTAINS_NOT:
				ArgUtils::assertTrue(is_array($value));
				
				foreach ($value as $relationEntry) {
					if ($this->in($relationEntry)) return false;
				}
				
				return true;
			case CriteriaComparator::OPERATOR_CONTAINS:
				ArgUtils::assertTrue(is_array($value));
				
				foreach ($value as $relationEntry) {
					if (!$this->in($relationEntry)) return false;
				}
				
				return true;
		}
	}
1165105
public function orWhere($field, $operator = null, $value = null)
    {
        $this->addOrWhere($field, $operator, $value);

        return $this;
    }
674873
public function where($column, $operator, $value, $filter = false)
    {
        return $this->createConstraint(' WHERE', $column, $operator, $value, $filter);
    }