Add the url rules

@param array|string $where
@param string   $regex_constraint

@return Route
344128
public function where($where, $regex_constraint = null)
    {
        if (is_array($where)) {
            $other_rule = $where;
        } else {
            $other_rule = [$where => $regex_constraint];
        }

        $this->with = array_merge($this->with, $other_rule);

        return $this;
    }
695625
public function validate($location, Constraint $constraint)
    {
        if (null === $location) {
            $this->context->addViolation($constraint->message);

            return;
        }
        $isRoot = new IsRoot();

        if ($isRoot->isSatisfiedBy($location)) {
            $this->context->addViolation($constraint->message);
        }
    }
1093066
protected function build_where($rules,$relation=false){
		$sql=array();
		for ($i=0; $i < sizeof($rules); $i++)
			if (is_string($rules[$i]))
				array_push($sql,"(".$rules[$i].")");
			else {
				$filtervalue = $rules[$i]["value"];
				$filteroperation = $rules[$i]["operation"];
				if ($filtervalue!=""){
					if (!$filteroperation)
						array_push($sql,$this->escape_name($rules[$i]["name"])." LIKE '%".$this->escape($filtervalue)."%'");
					else {
						if ($filteroperation != "IN") 
							$filtervalue = "'".$this->escape($filtervalue)."'";

						array_push($sql,$this->escape_name($rules[$i]["name"])." ".$filteroperation." ".$filtervalue);
					}
				}
			}

		if ($relation !== false && $relation !== ""){
			$relsql = $this->escape_name($this->config->relation_id["db_name"])." = '".$this->escape($relation)."'";
			if ($relation == "0")
				$relsql = "( ".$relsql." OR ".$this->escape_name($this->config->relation_id["db_name"])." IS NULL )";

			array_push($sql,$relsql);
		}
		return implode(" AND ",$sql);
	}
424959
public static function url(Validator $validator, $data, $pattern, $rule)
    {
        foreach (Validator::getValues($data, $pattern) as $attribute => $value) {
            if (null === $value || empty($value)) {
                continue;
            }
            if (false !== filter_var($value, FILTER_VALIDATE_URL)) {
                continue;
            }

            $validator->addError($attribute, $rule);
        }
    }
1166725
public static function findWhere(...$where): array
    {
        $self = static::getInstance();

        $whereParams = [];

        if (\count($where) === 2 && \is_string($where[0])) {
            $whereClause = $where[0];
            $whereParams = (array)$where[1];
        } elseif (\count($where)) {
            $whereOrTerms = [];
            foreach ($where as $keyValueSets) {
                $whereAndTerms = [];
                foreach ($keyValueSets as $keyName => $keyValue) {
                    if (\is_array($keyValue)) {
                        $keyValue = array_map(
                            function ($value) {
                                return DbProxy::quote($value);
                            },
                            $keyValue
                        );
                        $keyValue = implode(',', $keyValue);
                        $whereAndTerms[] = $self->name . '.' . $keyName . ' IN (' . $keyValue . ')';
                    } elseif (null === $keyValue) {
                        $whereAndTerms[] = $self->name . '.' . $keyName . ' IS NULL';
                    } elseif ('%' === $keyValue{0} || '%' === $keyValue{-1}) {
                        $whereAndTerms[] = $self->name . '.' . $keyName . ' LIKE ?';
                        $whereParams[] = $keyValue;
                    } else {
                        $whereAndTerms[] = $self->name . '.' . $keyName . ' = ?';
                        $whereParams[] = $keyValue;
                    }
                    if (!is_scalar($keyValue) && !is_null($keyValue)) {
                        throw new \InvalidArgumentException(
                            "Wrong arguments of method 'findWhere'.\n" .
                            "Please use syntax described at https://github.com/bluzphp/framework/wiki/Db-Table"
                        );
                    }
                }
                $whereOrTerms[] = '(' . implode(' AND ', $whereAndTerms) . ')';
            }
            $whereClause = '(' . implode(' OR ', $whereOrTerms) . ')';
        } else {
            throw new DbException(
                "Method `Table::findWhere()` can't return all records from table"
            );
        }

        return self::fetch($self->select . ' WHERE ' . $whereClause, $whereParams);
    }
898737
public function whereStruct(IBaseWhere $where, string $logicalOperator = LogicalOperator::AND)
    {
        $this->option->where[] = $where;
        return $this;
    }
475429
public function where($where)
    {
        //Argument 1 must be a string or array
        Argument::i()->test(1, 'string', 'array');
        
        if (is_string($where)) {
            $where = array($where);
        }
        
        $this->where = array_merge($this->where, $where);
        
        return $this;
    }
339932
public function where($where,$parse=null){
        if(!is_null($parse) && is_string($where)) {
            if(!is_array($parse)) {
                $parse = func_get_args();
                array_shift($parse);
            }
            $parse = array_map(array($this->db,'escapeString'),$parse);
            $where =   vsprintf($where,$parse);
        }elseif(is_object($where)){
            $where  =   get_object_vars($where);
        }
        if(is_string($where) && '' != $where){
            $map    =   array();
            $map['_string']   =   $where;
            $where  =   $map;
        }        
        if(isset($this->options['where'])){
            $this->options['where'] =   array_merge($this->options['where'],$where);
        }else{
            $this->options['where'] =   $where;
        }
        
        return $this;
    }
1297401
public function registerConstraint(string $name, string $constraint): Router
	{
		$this->constraints[$name] = $constraint;

		return $this;
	}
1315821
public function post($rule, $route = '', array $option = [], array $pattern = [])
    {
        return $this->rule($rule, $route, 'POST', $option, $pattern);
    }
7777
protected function _buildWhere($query, $where)
    {
        $clause = '';

        if (isset($where['condition'])) {
            $clause .= ' '.$where['condition'];
        }

        //converts subclause to string only if there's at least one where statement in it
        if (isset($where['clause'])) {
            if (empty($where['clause'])) {
                return '';
            }

            $clause .= ' (';
            foreach ($where['clause'] as $subwhere) {
                $clause .= $this->_buildWhere($query, $subwhere);
            }
            $clause .= ' )';

            return $clause;
        }

        list($columns, $property) = array_values(AnDomainQueryHelper::parseColumn($query, $where['property']));

        $value = isset($where['value']) ?  $where['value'] : null;
        $where['property'] = pick($columns, $where['property']);

        if ($property && !$value instanceof AnDomainQuery) {
            $constraint = $where['constraint'];

            if (is_object($value) || is_array($columns)) {
                if ($value instanceof AnObjectSet || is_array($value)) {
                    $values = $value;
                    $keys = array();
                    $clauses = array();
                    foreach ($values as $value) {
                        $columns = $property->serialize($value);
                        foreach ($columns as $column => $value) {
                            $keys[$column][] = $value;
                        }
                    }

                    foreach ($keys as $key => $values) {
                        $clauses[] = $this->_buildWhere($query, array('property' => $key, 'constraint' => $constraint, 'value' => $values));
                    }

                    $clause .= ' ('.implode(' AND ', $clauses).')';

                    return $clause;
                } else {
                    $columns = $property->serialize($value);

                    $clauses = array();
                    foreach ($columns as $column => $value) {
                        $clauses[] = $this->_buildWhere($query, array('property' => $column, 'constraint' => $constraint, 'value' => $value));
                    }

                    $clause .= ' ('.implode(' AND ', $clauses).')';

                    return $clause;
                }
            }
        }

        $clause  .= ' '.$where['property'];

        if (isset($where['constraint'])) {
            $value = $this->_store->quoteValue($where['value']);

            if ($value === 'NULL') {
                //force correct constraint
                if (strpos($where['constraint'], 'IS') === false) {
                    if (strpos($where['constraint'], '<>') !== false) {
                        $where['constraint'] = ' IS NOT ';
                    } elseif (strpos($where['constraint'], '=') !== false) {
                        $where['constraint'] = ' IS ';
                    }
                }
            }

            if (in_array($where['constraint'], array('IN', 'NOT IN'))) {
                $value = ' ( '.$value.' ) ';
            }

            $clause .= ' '.$where['constraint'].' '.$value;
        }

        return $clause;
    }
687260
public function concatenate( $url, $where = [] ) {
		if ( $this->getUrl() === static::WILDCARD || $url === static::WILDCARD ) {
			return new static( static::WILDCARD );
		}

		$leading = UrlUtility::addLeadingSlash( UrlUtility::removeTrailingSlash( $this->getUrl() ), true );
		$trailing = UrlUtility::addLeadingSlash( UrlUtility::addTrailingSlash( $url ) );

		$concatenated = new static( $leading . $trailing, array_merge(
			$this->getUrlWhere(),
			$where
		) );

		return $concatenated;
	}
754794
public function whereRegexp($field, $value, $flags = 'ALL')
    {
        $this->wheres['must'][] = [
            'regexp' => [
                $field => [
                    'value' => $value,
                    'flags' => $flags,
                ],
            ],
        ];

        return $this;
    }
282140
public function query($method, $pattern, $callback)
    {
        $route = new Route($pattern, $callback, $method);
        $this['router']->addRoute($route);

        return $route;
    }
299297
public RouteMatcher putWithRegEx(String regex, Handler<HttpServerRequest> handler) {
		addRegEx(regex, handler, putBindings);
		return this;
	}
946092
public static Constraint pattern(final Object regex) {
		return new Constraint("pattern", patternPayload(regex)) {
			public boolean isValid(Object actualValue) {
				if (actualValue != null) {
					if (regex != null && regex instanceof String) {
						if (!(actualValue instanceof String) || !((String) actualValue).matches((String) regex)) {
							return false;
						}
					}
				}
				return true;
			}
		};
	}
1080129
public RouteMatcher postWithRegEx(String regex, Handler<HttpServerRequest> handler) {
		addRegEx(regex, handler, postBindings);
		return this;
	}