class SelectQuery implements QueryInterface (View source)

This query class coordinates a select query build from Bolt's custom query DSL as documented here:.

Properties

protected QueryBuilder $qb
protected QueryParameterParser $parser
protected string $contentType
protected array $params
protected Filter[] $filters
protected array $replacements
protected bool $singleFetchMode
protected int $index
protected array $coreFields
protected array $coreDateFields
protected array $taxonomyFields
protected array $referenceFields
protected array $regularFields
protected string $anything

Methods

__construct(QueryBuilder|null $qb = null, QueryParameterParser $parser, Config $config)

Constructor.

void
setContentType(string $contentType)

Sets the ContentType that this query will run against.

string
getContentType()

Gets the ContentType that this query will run against.

bool
isSingleton()

No description

bool
shouldReturnSingle()

No description

void
setParameters(array $params)

Sets the parameters that will filter / alter the query.

getParameter(string $name)

Getter to allow access to a set parameter.

void
setParameter(string $name, $value)

Setter to allow writing to a named parameter.

Base|null
getWhereExpression()

Creates a composite expression that adds all the attached filters individual expressions into a combined one.

array
getWhereParameters()

Returns all the parameters for the query.

void
addFilter(Filter $filter)

No description

array
getFilters()

Returns all the filters attached to the query.

build()

Part of the QueryInterface this turns all the input into a Doctrine QueryBuilder object and is usually run just before query execution.

QueryBuilder
getQueryBuilder()

Allows public access to the QueryBuilder object.

void
setQueryBuilder(QueryBuilder $qb)

Allows replacing the default QueryBuilder.

bool|null
getSingleFetchMode()

Returns whether the query is in single fetch mode.

void
setSingleFetchMode(bool|null $value)

Turns single fetch mode on or off.

string
__toString()

No description

void
processFilters()

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

void
doReferenceJoins()

Allows key-value queries for bolt_user (id) values.

void
doTaxonomyJoins()

Allows key-value queries for bolt_taxonomy (slug) values.

void
doFieldJoins()

Allows key-value queries for bolt_field values.

void
setContentTypeFilter(array $contentTypes)

No description

array
getTaxonomyFields()

No description

int
getIndex()

No description

void
incrementIndex()

No description

array
getCoreFields()

No description

getConfig()

No description

Details

__construct(QueryBuilder|null $qb = null, QueryParameterParser $parser, Config $config)

Constructor.

Parameters

QueryBuilder|null $qb
QueryParameterParser $parser
Config $config

void setContentType(string $contentType)

Sets the ContentType that this query will run against.

Parameters

string $contentType

Return Value

void

string getContentType()

Gets the ContentType that this query will run against.

Return Value

string

bool isSingleton()

Return Value

bool

bool shouldReturnSingle()

Return Value

bool

void setParameters(array $params)

Sets the parameters that will filter / alter the query.

Parameters

array $params

Return Value

void

getParameter(string $name)

Getter to allow access to a set parameter.

Parameters

string $name

void setParameter(string $name, $value)

Setter to allow writing to a named parameter.

Parameters

string $name
$value

Return Value

void

Base|null getWhereExpression()

Creates a composite expression that adds all the attached filters individual expressions into a combined one.

Return Value

Base|null

array getWhereParameters()

Returns all the parameters for the query.

Return Value

array

void addFilter(Filter $filter)

Parameters

Filter $filter

Return Value

void

array getFilters()

Returns all the filters attached to the query.

Return Value

array

build()

Part of the QueryInterface this turns all the input into a Doctrine QueryBuilder object and is usually run just before query execution.

That allows modifications to be made to any of the parameters up until query execution time.

QueryBuilder getQueryBuilder()

Allows public access to the QueryBuilder object.

Return Value

QueryBuilder

void setQueryBuilder(QueryBuilder $qb)

Allows replacing the default QueryBuilder.

Parameters

QueryBuilder $qb

Return Value

void

bool|null getSingleFetchMode()

Returns whether the query is in single fetch mode.

Return Value

bool|null

void setSingleFetchMode(bool|null $value)

Turns single fetch mode on or off.

Parameters

bool|null $value

Return Value

void

string __toString()

Return Value

string

protected void processFilters()

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

Return Value

void

Exceptions

Exception

void doReferenceJoins()

Allows key-value queries for bolt_user (id) values.

Return Value

void

void doTaxonomyJoins()

Allows key-value queries for bolt_taxonomy (slug) values.

Return Value

void

void doFieldJoins()

Allows key-value queries for bolt_field values.

Return Value

void

void setContentTypeFilter(array $contentTypes)

Parameters

array $contentTypes

Return Value

void

array getTaxonomyFields()

Return Value

array

int getIndex()

Return Value

int

void incrementIndex()

Return Value

void

array getCoreFields()

Return Value

array

Config getConfig()

Return Value

Config