PHP 클래스 Bolt\Storage\Query\ContentQueryParser

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

보호된 프로퍼티들

프로퍼티 타입 설명
$contentTypes array
$directiveHandlers callable[]
$directives array
$em Bolt\Storage\EntityManager
$handlers callable[]
$identifier string
$operation string
$operations array
$params array
$query string
$services Bolt\Storage\Query\QueryInterface[]

공개 메소드들

메소드 설명
__construct ( EntityManager $em, Bolt\Storage\Query\QueryInterface $queryHandler = null ) Constructor.
addDirectiveHandler ( string $key, callable $callback = null ) Adds a handler for the named directive.
addHandler ( string $operation, callable $callback ) Adds a handler AND operation for the named operation.
addOperation ( string $operation ) Adds a new operation to the list supported.
addService ( string $operation, Bolt\Storage\Query\QueryInterface $service ) Adds a service for the named operation.
fetch ( ) : QueryResultset Runs the query and fetches the results.
getContentTypes ( ) : array Returns the parsed content types.
getDirective ( string $key ) : string Returns a directive from the parsed list.
getDirectiveHandler ( string $check ) : callable Returns the handler for the named directive.
getEntityManager ( ) : EntityManager Gets the object EntityManager
getHandler ( string $operation ) : callable Returns a handler for the named operation.
getIdentifier ( ) : string Returns the parsed identifier.
getOperation ( ) : string Returns the parsed operation.
getOperations ( ) : array Getter to return the currently registered operations.
getParameter ( string $param ) : array Returns a single named parameter.
getParameters ( ) : array Returns the current parameters.
getService ( string $operation ) : Bolt\Storage\Query\QueryInterface Returns a service for the named operation.
hasDirectiveHandler ( string $check ) : boolean Returns boolean for existence of handler.
parse ( ) Parse a query.
removeOperation ( string $operation ) Removes an operation from the list supported.
runDirectives ( Bolt\Storage\Query\QueryInterface $query, array $skipDirective = [] ) This runs the callbacks attached to each directive command.
setDirective ( string $key, mixed $value ) Sets a directive for the named key.
setParameter ( string $param, mixed $value ) Sets a single input parameter.
setParameters ( array $params ) Sets the input parameters to handle.
setQuery ( string $query ) Sets the input query.

보호된 메소드들

메소드 설명
parseContent ( ) Parses the content area of the querystring.
parseDirectives ( ) Directives are all of the other parameters supported by Bolt that do not relate to an actual filter query. Some examples include 'printquery', 'limit', 'order' or 'returnsingle'.
parseOperation ( ) Internal method that takes the 'query' part of the input and parses it into one of the various operations supported.
setupDefaults ( ) Internal method to initialise the default handlers.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( EntityManager $em, Bolt\Storage\Query\QueryInterface $queryHandler = null )
$em Bolt\Storage\EntityManager
$queryHandler Bolt\Storage\Query\QueryInterface

addDirectiveHandler() 공개 메소드

Adds a handler for the named directive.
public addDirectiveHandler ( string $key, callable $callback = null )
$key string
$callback callable

addHandler() 공개 메소드

Adds a handler AND operation for the named operation.
public addHandler ( string $operation, callable $callback )
$operation string
$callback callable

addOperation() 공개 메소드

Adds a new operation to the list supported.
public addOperation ( string $operation )
$operation string name of operation to parse for

addService() 공개 메소드

Adds a service for the named operation.
public addService ( string $operation, Bolt\Storage\Query\QueryInterface $service )
$operation string
$service Bolt\Storage\Query\QueryInterface

fetch() 공개 메소드

Runs the query and fetches the results.
public fetch ( ) : QueryResultset
리턴 QueryResultset

getContentTypes() 공개 메소드

Returns the parsed content types.
public getContentTypes ( ) : array
리턴 array

getDirective() 공개 메소드

Returns a directive from the parsed list.
public getDirective ( string $key ) : string
$key string
리턴 string

getDirectiveHandler() 공개 메소드

Returns the handler for the named directive.
public getDirectiveHandler ( string $check ) : callable
$check string
리턴 callable

getEntityManager() 공개 메소드

Gets the object EntityManager
public getEntityManager ( ) : EntityManager
리턴 Bolt\Storage\EntityManager

getHandler() 공개 메소드

Returns a handler for the named operation.
public getHandler ( string $operation ) : callable
$operation string
리턴 callable

getIdentifier() 공개 메소드

Returns the parsed identifier.
public getIdentifier ( ) : string
리턴 string

getOperation() 공개 메소드

Returns the parsed operation.
public getOperation ( ) : string
리턴 string

getOperations() 공개 메소드

Getter to return the currently registered operations.
public getOperations ( ) : array
리턴 array

getParameter() 공개 메소드

Returns a single named parameter.
public getParameter ( string $param ) : array
$param string
리턴 array

getParameters() 공개 메소드

Returns the current parameters.
public getParameters ( ) : array
리턴 array

getService() 공개 메소드

Returns a service for the named operation.
public getService ( string $operation ) : Bolt\Storage\Query\QueryInterface
$operation string
리턴 Bolt\Storage\Query\QueryInterface

hasDirectiveHandler() 공개 메소드

Returns boolean for existence of handler.
public hasDirectiveHandler ( string $check ) : boolean
$check string
리턴 boolean

parse() 공개 메소드

Parse a query.
public parse ( )

parseContent() 보호된 메소드

Parses the content area of the querystring.
protected parseContent ( )

parseDirectives() 보호된 메소드

All these need to parsed and taken out of the params that are sent to the query.
protected parseDirectives ( )

parseOperation() 보호된 메소드

A simple select operation will just contain the ContentType eg 'pages' but additional operations can be triggered using the '/' separator.
protected parseOperation ( )

removeOperation() 공개 메소드

Removes an operation from the list supported.
public removeOperation ( string $operation )
$operation string name of operation to remove

runDirectives() 공개 메소드

This runs the callbacks attached to each directive command.
public runDirectives ( Bolt\Storage\Query\QueryInterface $query, array $skipDirective = [] )
$query Bolt\Storage\Query\QueryInterface
$skipDirective array

setDirective() 공개 메소드

Sets a directive for the named key.
public setDirective ( string $key, mixed $value )
$key string
$value mixed

setParameter() 공개 메소드

Sets a single input parameter.
public setParameter ( string $param, mixed $value )
$param string
$value mixed

setParameters() 공개 메소드

Sets the input parameters to handle.
public setParameters ( array $params )
$params array

setQuery() 공개 메소드

Sets the input query.
public setQuery ( string $query )
$query string

setupDefaults() 보호된 메소드

Internal method to initialise the default handlers.
protected setupDefaults ( )

프로퍼티 상세

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

protected array $contentTypes
리턴 array

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

protected callable[] $directiveHandlers
리턴 callable[]

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

protected array $directives
리턴 array

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

protected EntityManager,Bolt\Storage $em
리턴 Bolt\Storage\EntityManager

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

protected callable[] $handlers
리턴 callable[]

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

protected string $identifier
리턴 string

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

protected string $operation
리턴 string

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

protected array $operations
리턴 array

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

protected array $params
리턴 array

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

protected string $query
리턴 string

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

protected QueryInterface[],Bolt\Storage\Query $services
리턴 Bolt\Storage\Query\QueryInterface[]