CoolCMS API

Filter

Table of Contents

Methods

apply()  : void
Applies the filter to the Doctrine QueryBuilder.
applyWithCondition()  : string|null
Applies the filter as a with-condition on a join in the QueryBuilder.
getBindings()  : ArrayCollection<int, Parameter>
Returns the filter's parameter bindings.
getFields()  : array<string|int, string>|string
Returns the field or fields the filter applies to.
getType()  : string
Returns the filter type/operator (e.g. '=', 'LIKE', 'IN').
getValue()  : mixed
Returns the filter value.
setFields()  : static
Sets the field or fields the filter applies to.
setFromTableAlias()  : static
Sets the alias of the main table for join operations.
setTextTableAlias()  : static
Sets the alias of the text (translations) table for join operations.
toSql()  : string
Builds the SQL condition for the filter.

Methods

apply()

Applies the filter to the Doctrine QueryBuilder.

public apply(QueryBuilder $qb, int|string $index) : void
Parameters
$qb : QueryBuilder
$index : int|string

applyWithCondition()

Applies the filter as a with-condition on a join in the QueryBuilder.

public applyWithCondition(QueryBuilder $qb, string $joinAlias, string $column, int &$paramIndex) : string|null

Returns the DQL condition (string), or null when the filter has nothing to add. Each filter builds its own condition, so OrmRepository needs no filter-specific logic.

Parameters
$qb : QueryBuilder
$joinAlias : string
$column : string
$paramIndex : int

parameter counter passed by reference (incremented inside)

Return values
string|null

getBindings()

Returns the filter's parameter bindings.

public getBindings([string|int|null $index = null ]) : ArrayCollection<int, Parameter>
Parameters
$index : string|int|null = null
Return values
ArrayCollection<int, Parameter>

getFields()

Returns the field or fields the filter applies to.

public getFields() : array<string|int, string>|string
Return values
array<string|int, string>|string

getType()

Returns the filter type/operator (e.g. '=', 'LIKE', 'IN').

public getType() : string
Return values
string

getValue()

Returns the filter value.

public getValue() : mixed

setFields()

Sets the field or fields the filter applies to.

public setFields(array<string|int, string>|string $fields) : static
Parameters
$fields : array<string|int, string>|string
Return values
static

setFromTableAlias()

Sets the alias of the main table for join operations.

public setFromTableAlias(string|null $alias) : static
Parameters
$alias : string|null
Return values
static

setTextTableAlias()

Sets the alias of the text (translations) table for join operations.

public setTextTableAlias(string|null $alias) : static
Parameters
$alias : string|null
Return values
static

toSql()

Builds the SQL condition for the filter.

public toSql(QueryBuilder $qb[, int|null $index = null ]) : string
Parameters
$qb : QueryBuilder
$index : int|null = null
Return values
string
On this page

Search results