PHP 클래스 Bolt\Storage\Query\QueryParameterParser

@author Ross Riley
파일 보기 프로젝트 열기: bolt/bolt 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$alias string

보호된 프로퍼티들

프로퍼티 타입 설명
$expr Doctrine\DBAL\Query\Expression\ExpressionBuilder
$filterHandlers Filter[]
$key string
$value mixed
$valueMatchers array

공개 메소드들

메소드 설명
__construct ( Doctrine\DBAL\Query\Expression\ExpressionBuilder $expr = null ) Constructor.
addFilterHandler ( callable $handler ) The goal of this class is to turn any key:value into a Filter class.
addValueMatcher ( string $token, array $params = [], boolean $priority = null ) Adds an additional token to parse for value parameters.
defaultFilterHandler ( string $key, string $value, Doctrine\DBAL\Query\Expression\ExpressionBuilder $expr ) : Filter The default handler is the last to be run and handler simple value parsing.
getFilter ( string $key, mixed $value = null ) : Filter | null Runs the keys/values through the relevant parsers.
incorrectQueryHandler ( string $key, string $value, Doctrine\DBAL\Query\Expression\ExpressionBuilder $expr ) Handles some errors in key/value string formatting.
multipleKeyAndValueHandler ( string $key, string $value, Doctrine\DBAL\Query\Expression\ExpressionBuilder $expr ) : Filter | null This handler processes 'triple pipe' queries as implemented in Bolt It looks for three pipes in the key and value and creates an OR composite expression for example: 'username|||email':'fred|||pete'.
multipleValueHandler ( string $key, string $value, Doctrine\DBAL\Query\Expression\ExpressionBuilder $expr ) : Filter | null This handler processes multiple value queries as defined in the Bolt 'Fetching Content' documentation. It allows a value to be parsed to and AND/OR expression.
parseValue ( string $value ) : array This method uses the defined value matchers to parse a passed in value to the following component parts: [ 'value' => 'operator' => 'matched' => ]
setAlias ( string $alias ) Sets the select alias to be used in sql queries.
setupDefaults ( )

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Doctrine\DBAL\Query\Expression\ExpressionBuilder $expr = null )
$expr Doctrine\DBAL\Query\Expression\ExpressionBuilder

addFilterHandler() 공개 메소드

Adding a handler here will push the new filter callback onto the top of the Queue along with the built in defaults. Note: the callback should either return nothing or an instance of \Bolt\Storage\Query\Filter
public addFilterHandler ( callable $handler )
$handler callable

addValueMatcher() 공개 메소드

This gives the ability to define additional value -> operator matches
public addValueMatcher ( string $token, array $params = [], boolean $priority = null )
$token string Regex pattern to match against
$params array Options to provide to the matched param
$priority boolean If set item will be prepended to start of list

defaultFilterHandler() 공개 메소드

The default handler is the last to be run and handler simple value parsing.
public defaultFilterHandler ( string $key, string $value, Doctrine\DBAL\Query\Expression\ExpressionBuilder $expr ) : Filter
$key string
$value string
$expr Doctrine\DBAL\Query\Expression\ExpressionBuilder
리턴 Filter

getFilter() 공개 메소드

Runs the keys/values through the relevant parsers.
public getFilter ( string $key, mixed $value = null ) : Filter | null
$key string
$value mixed
리턴 Filter | null

incorrectQueryHandler() 공개 메소드

Handles some errors in key/value string formatting.
public incorrectQueryHandler ( string $key, string $value, Doctrine\DBAL\Query\Expression\ExpressionBuilder $expr )
$key string
$value string
$expr Doctrine\DBAL\Query\Expression\ExpressionBuilder

multipleKeyAndValueHandler() 공개 메소드

This handler processes 'triple pipe' queries as implemented in Bolt It looks for three pipes in the key and value and creates an OR composite expression for example: 'username|||email':'fred|||pete'.
public multipleKeyAndValueHandler ( string $key, string $value, Doctrine\DBAL\Query\Expression\ExpressionBuilder $expr ) : Filter | null
$key string
$value string
$expr Doctrine\DBAL\Query\Expression\ExpressionBuilder
리턴 Filter | null

multipleValueHandler() 공개 메소드

For example, this handler will correctly parse values like: 'username': 'fred||bob' 'id': '<5 && !1'
public multipleValueHandler ( string $key, string $value, Doctrine\DBAL\Query\Expression\ExpressionBuilder $expr ) : Filter | null
$key string
$value string
$expr Doctrine\DBAL\Query\Expression\ExpressionBuilder
리턴 Filter | null

parseValue() 공개 메소드

This method uses the defined value matchers to parse a passed in value to the following component parts: [ 'value' => 'operator' => 'matched' => ]
public parseValue ( string $value ) : array
$value string Value to process
리턴 array Parsed values

setAlias() 공개 메소드

Sets the select alias to be used in sql queries.
public setAlias ( string $alias )
$alias string

setupDefaults() 공개 메소드

public setupDefaults ( )

프로퍼티 상세

$alias 공개적으로 프로퍼티

public string $alias
리턴 string

$expr 보호되어 있는 프로퍼티

protected ExpressionBuilder,Doctrine\DBAL\Query\Expression $expr
리턴 Doctrine\DBAL\Query\Expression\ExpressionBuilder

$filterHandlers 보호되어 있는 프로퍼티

protected Filter[],Bolt\Storage\Query $filterHandlers
리턴 Filter[]

$key 보호되어 있는 프로퍼티

protected string $key
리턴 string

$value 보호되어 있는 프로퍼티

protected mixed $value
리턴 mixed

$valueMatchers 보호되어 있는 프로퍼티

protected array $valueMatchers
리턴 array