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

One boundary of a window frame: UNBOUNDED, CURRENT ROW, or an offset PRECEDING or FOLLOWING.

An offset is a number, a parameter marker, or INTERVAL expr unit for a RANGE over a temporal ordering. The window that holds the boundary derives the offset. Source: https://dev.mysql.com/doc/refman/8.4/en/window-functions-frames.html.

Reading the offset of a frame boundarydoctest
$bound = new \SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBound(\SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBoundKind::Preceding, new \SqlSemantics\Platform\MySql\Statement\Literal\NumberLiteral('2'));
    $bound->offset->text // => '2'
Refusing an offset on a boundary that takes nonedoctest
new \SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBound(\SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBoundKind::CurrentRow, new \SqlSemantics\Platform\MySql\Statement\Literal\NumberLiteral('1')) // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\InvalidConstruction

Properties§

public Scalar|null $offset = null
public IntervalUnit|null $unit = null

Methods§

public function __construct(
    public FrameBoundKind $kind,
    public Scalar|null $offset = null,
    public IntervalUnit|null $unit = null,
)

Parameters

$kindFrameBoundKindThe kind of boundary
$offsetScalar|nullThe distance from the current row; present exactly for PRECEDING and FOLLOWING
$unitIntervalUnit|nullThe unit of an INTERVAL offset
Calls 2
public function render(Output $out): void

Writes the boundary.

Parameters

$outOutput
Test cases 1
Calls 3

Test cases 5§

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 4

Relations§

Instantiated in 3
Type declarations 2