final class SortTerm
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

One ordering term: an expression with its optional direction and NULL placement.

The same term form orders query results, window partitions and aggregate arguments, and lists the columns of an index or of a conflict target.

Reading an ordering termdoctest
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT a FROM t ORDER BY a + 1 ASC NULLS FIRST');
    $term = $query->statement->orderBy[0];
    [$term->direction, $term->nulls] // => [\SqlSemantics\Platform\Sqlite\Statement\Query\Ordering\SortDirection::Ascending, \SqlSemantics\Platform\Sqlite\Statement\Query\Ordering\NullsOrder::First]

Properties§

public Scalar $expression
public SortDirection|null $direction = null
public NullsOrder|null $nulls = null

Methods§

public function __construct(
    public Scalar $expression,
    public SortDirection|null $direction = null,
    public NullsOrder|null $nulls = null,
)

Parameters

$expressionScalarThe ordering expression
$directionSortDirection|nullThe written direction
$nullsNullsOrder|nullThe written NULL placement
public function render(Output $out): void

Writes the expression, the direction and the NULL placement.

Parameters

$outOutput
Calls 2

Test cases 15§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 14

Relations§

Instantiated in 2
Constant reads 8
Type declarations 6