class Filter (View source)

This class represents a single filter that converts to an expression along with associated query values.

Properties

protected $key
protected Composite $expression
protected array $parameters

Methods

void
setKey(string|array $key)

Sets the key that this filter affects.

string|array
getKey()

Getter for key.

string
getExpression()

Gets the compiled expression as a string. This will look something like (alias.key = :placeholder).

void
setExpression(Composite $expression)

Allows replacing the expression object with a modified one.

Composite
getExpressionObject()

Returns the actual object of the expression. This is generally only needed for on the fly modification, to get the compiled expression use getExpression().

array
getParameters()

Returns the array of parameters attached to this filter. These are normally used to replace placeholders at compile time.

void
setParameters(array $parameters)

Setter method to replace parameters.

bool
hasParameter(string $param)

Helper method to check if parameters are set for a specific key.

void
setParameter(string $param, $value)

Allows setting a parameter for a single key.

Details

void setKey(string|array $key)

Sets the key that this filter affects.

Parameters

string|array $key

Return Value

void

string|array getKey()

Getter for key.

Return Value

string|array

string getExpression()

Gets the compiled expression as a string. This will look something like (alias.key = :placeholder).

Return Value

string

void setExpression(Composite $expression)

Allows replacing the expression object with a modified one.

Parameters

Composite $expression

Return Value

void

Composite getExpressionObject()

Returns the actual object of the expression. This is generally only needed for on the fly modification, to get the compiled expression use getExpression().

Return Value

Composite

array getParameters()

Returns the array of parameters attached to this filter. These are normally used to replace placeholders at compile time.

Return Value

array

void setParameters(array $parameters)

Setter method to replace parameters.

Parameters

array $parameters

Return Value

void

bool hasParameter(string $param)

Helper method to check if parameters are set for a specific key.

Parameters

string $param

Return Value

bool

void setParameter(string $param, $value)

Allows setting a parameter for a single key.

Parameters

string $param
$value

Return Value

void