OrderClauseExpression
in package
implements
ExpressionInterface, FieldInterface
uses
FieldTrait
An expression object for complex ORDER BY clauses
Table of Contents
Interfaces
- ExpressionInterface
- An interface used by Expression objects.
- FieldInterface
- Describes a getter and a setter for the a field property. Useful for expressions that contain an identifier to compare against.
Properties
- $_direction : string
- The direction of sorting.
- $_field : ExpressionInterface|array<string|int, mixed>|string
- The field name or expression to be used in the left hand side of the operator
Methods
- __clone() : void
- Create a deep clone of the order clause.
- __construct() : mixed
- Constructor
- getField() : ExpressionInterface|array<string|int, mixed>|string
- Returns the field name
- setField() : void
- Sets the field name
- sql() : string
- Converts the Node into a SQL string fragment.
- traverse() : $this
- Iterates over each part of the expression recursively for every level of the expressions tree and executes the $callback callable passing as first parameter the instance of the expression currently being iterated.
Properties
$_direction
The direction of sorting.
protected
string
$_direction
$_field
The field name or expression to be used in the left hand side of the operator
protected
ExpressionInterface|array<string|int, mixed>|string
$_field
Methods
__clone()
Create a deep clone of the order clause.
public
__clone() : void
__construct()
Constructor
public
__construct(ExpressionInterface|string $field, string $direction) : mixed
Parameters
- $field : ExpressionInterface|string
-
The field to order on.
- $direction : string
-
The direction to sort on.
getField()
Returns the field name
public
getField() : ExpressionInterface|array<string|int, mixed>|string
Return values
ExpressionInterface|array<string|int, mixed>|stringsetField()
Sets the field name
public
setField(ExpressionInterface|array<string|int, mixed>|string $field) : void
Parameters
- $field : ExpressionInterface|array<string|int, mixed>|string
-
The field to compare with.
sql()
Converts the Node into a SQL string fragment.
public
sql(ValueBinder $binder) : string
Parameters
- $binder : ValueBinder
-
Parameter binder
Tags
Return values
stringtraverse()
Iterates over each part of the expression recursively for every level of the expressions tree and executes the $callback callable passing as first parameter the instance of the expression currently being iterated.
public
traverse(Closure $callback) : $this
Parameters
- $callback : Closure
-
The callable to apply to all nodes.