PHP Class Bolt\Storage\Query\SelectQuery

@link https://docs.bolt.cm/templates/content-fetching The resulting QueryBuilder object is then passed through to the individual field handlers where they can perform value transformations.
Author: Ross Riley ([email protected])
Inheritance: implements Bolt\Storage\Query\QueryInterface
Afficher le fichier Open project: bolt/bolt Class Usage Examples

Protected Properties

Свойство Type Description
$contentType string
$filters Filter[]
$params array
$parser QueryParameterParser
$qb Doctrine\DBAL\Query\QueryBuilder
$replacements
$singleFetchMode boolean

Méthodes publiques

Méthode Description
__construct ( Doctrine\DBAL\Query\QueryBuilder $qb, QueryParameterParser $parser ) Constructor.
__toString ( ) : string
addFilter ( Filter $filter )
build ( ) : Doctrine\DBAL\Query\QueryBuilder Part of the QueryInterface this turns all the input into a Doctrine QueryBuilder object and is usually run just before query execution.
getContentType ( ) : string Gets the ContentType that this query will run against.
getFilters ( ) : Filter[] Returns all the filters attached to the query
getQueryBuilder ( ) : Doctrine\DBAL\Query\QueryBuilder Allows public access to the QueryBuilder object
getSingleFetchMode ( ) : boolean Returns whether the query is in single fetch mode.
getWhereExpression ( ) : CompositeExpression Creates a composite expression that adds all the attached filters individual expressions into a combined one.
getWhereParameters ( ) : array Returns all the parameters for the query.
getWhereParametersFor ( string $fieldName ) : array Gets all the parameters for a specific field name.
setContentType ( string $contentType ) Sets the ContentType that this query will run against.
setParameters ( array $params ) Sets the parameters that will filter / alter the query
setQueryBuilder ( Doctrine\DBAL\Query\QueryBuilder $qb ) Allows replacing the default QueryBuilder.
setSingleFetchMode ( boolean $value ) Turns single fetch mode on or off.
setWhereParameter ( string $key, mixed $value ) Sets all the parameters for a specific field name.

Méthodes protégées

Méthode Description
processFilters ( ) Internal method that runs the individual key/value input through the QueryParameterParser. This allows complicated expressions to be turned into simple sql expressions

Method Details

__construct() public méthode

Constructor.
public __construct ( Doctrine\DBAL\Query\QueryBuilder $qb, QueryParameterParser $parser )
$qb Doctrine\DBAL\Query\QueryBuilder
$parser QueryParameterParser

__toString() public méthode

public __toString ( ) : string
Résultat string String representation of query

addFilter() public méthode

public addFilter ( Filter $filter )
$filter Filter

build() public méthode

That allows modifications to be made to any of the parameters up until query execution time.
public build ( ) : Doctrine\DBAL\Query\QueryBuilder
Résultat Doctrine\DBAL\Query\QueryBuilder

getContentType() public méthode

Gets the ContentType that this query will run against.
public getContentType ( ) : string
Résultat string

getFilters() public méthode

Returns all the filters attached to the query
public getFilters ( ) : Filter[]
Résultat Filter[]

getQueryBuilder() public méthode

Allows public access to the QueryBuilder object
public getQueryBuilder ( ) : Doctrine\DBAL\Query\QueryBuilder
Résultat Doctrine\DBAL\Query\QueryBuilder

getSingleFetchMode() public méthode

Returns whether the query is in single fetch mode.
public getSingleFetchMode ( ) : boolean
Résultat boolean

getWhereExpression() public méthode

Creates a composite expression that adds all the attached filters individual expressions into a combined one.
public getWhereExpression ( ) : CompositeExpression
Résultat Doctrine\DBAL\Query\Expression\CompositeExpression

getWhereParameters() public méthode

Returns all the parameters for the query.
public getWhereParameters ( ) : array
Résultat array

getWhereParametersFor() public méthode

Gets all the parameters for a specific field name.
public getWhereParametersFor ( string $fieldName ) : array
$fieldName string
Résultat array array of key=>value parameters

processFilters() protected méthode

Internal method that runs the individual key/value input through the QueryParameterParser. This allows complicated expressions to be turned into simple sql expressions
protected processFilters ( )

setContentType() public méthode

Sets the ContentType that this query will run against.
public setContentType ( string $contentType )
$contentType string

setParameters() public méthode

Sets the parameters that will filter / alter the query
public setParameters ( array $params )
$params array

setQueryBuilder() public méthode

Allows replacing the default QueryBuilder.
public setQueryBuilder ( Doctrine\DBAL\Query\QueryBuilder $qb )
$qb Doctrine\DBAL\Query\QueryBuilder

setSingleFetchMode() public méthode

Turns single fetch mode on or off.
public setSingleFetchMode ( boolean $value )
$value boolean

setWhereParameter() public méthode

Sets all the parameters for a specific field name.
public setWhereParameter ( string $key, mixed $value )
$key string
$value mixed

Property Details

$contentType protected_oe property

protected string $contentType
Résultat string

$filters protected_oe property

protected Filter[],Bolt\Storage\Query $filters
Résultat Filter[]

$params protected_oe property

protected array $params
Résultat array

$parser protected_oe property

protected QueryParameterParser,Bolt\Storage\Query $parser
Résultat QueryParameterParser

$qb protected_oe property

protected QueryBuilder,Doctrine\DBAL\Query $qb
Résultat Doctrine\DBAL\Query\QueryBuilder

$replacements protected_oe property

protected $replacements

$singleFetchMode protected_oe property

protected bool $singleFetchMode
Résultat boolean