class ClosureExpressionVisitor extends ExpressionVisitor (View source)

Walks an expression graph and turns it into a PHP closure.

This closure can be used with {@Collection#filter()} and is used internally by {@ArrayCollection#select()}.

Methods

mixed
walkComparison(Comparison $comparison)

Convert a comparison expression into the target query language output

mixed
walkValue(Value $value)

Convert a value expression into the target query language part.

mixed
walkCompositeExpression(CompositeExpression $expr)

Convert a composite expression into the target query language output

mixed
dispatch(Expression $expr)

Dispatch walking an expression to the appropriate handler.

static mixed
getObjectFieldValue($object, $field)

Access the field of a given object. This field has to be public directly or indirectly (through an accessor get* or a magic method, __get, __call).

static Closure
sortByField(string $name, int $orientation = 1, Closure $next = null)

Helper for sorting arrays of objects based on multiple fields + orientations.

Details

mixed walkComparison(Comparison $comparison)

Convert a comparison expression into the target query language output

Parameters

Comparison $comparison

Return Value

mixed

mixed walkValue(Value $value)

Convert a value expression into the target query language part.

Parameters

Value $value

Return Value

mixed

mixed walkCompositeExpression(CompositeExpression $expr)

Convert a composite expression into the target query language output

Parameters

CompositeExpression $expr

Return Value

mixed

mixed dispatch(Expression $expr)

Dispatch walking an expression to the appropriate handler.

Parameters

Expression $expr

Return Value

mixed

static mixed getObjectFieldValue($object, $field)

Access the field of a given object. This field has to be public directly or indirectly (through an accessor get* or a magic method, __get, __call).

is*() is not supported.

Parameters

$object
$field

Return Value

mixed

static Closure sortByField(string $name, int $orientation = 1, Closure $next = null)

Helper for sorting arrays of objects based on multiple fields + orientations.

Parameters

string $name
int $orientation
Closure $next

Return Value

Closure