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

The frame of a window: its unit, its boundaries and its exclusion.

The short form names the start only, which is not FOLLOWING, and ends at the current row; the BETWEEN form names both ends. UNBOUNDED FOLLOWING cannot start a frame and UNBOUNDED PRECEDING cannot end one. Source: https://dev.mysql.com/doc/refman/8.4/en/window-functions-frames.html.

Reading both ends of a framedoctest
$frame = new \SqlSemantics\Platform\MySql\Statement\Call\Window\Frame(\SqlSemantics\Platform\MySql\Statement\Call\Window\FrameUnit::Rows, new \SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBound(\SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBoundKind::UnboundedPreceding), new \SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBound(\SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBoundKind::CurrentRow));
    $frame->end?->kind // => \SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBoundKind::CurrentRow
Refusing a start the grammar does not admitdoctest
new \SqlSemantics\Platform\MySql\Statement\Call\Window\Frame(\SqlSemantics\Platform\MySql\Statement\Call\Window\FrameUnit::Rows, new \SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBound(\SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBoundKind::UnboundedFollowing)) // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\InvalidConstruction

Properties§

public FrameUnit $unit
public FrameBound $start
public FrameBound|null $end = null
public FrameExclusion|null $exclusion = null

Methods§

public function __construct(
    public FrameUnit $unit,
    public FrameBound $start,
    public FrameBound|null $end = null,
    public FrameExclusion|null $exclusion = null,
)

Parameters

$unitFrameUnitThe unit
$startFrameBoundThe start boundary
$endFrameBound|nullThe end boundary of the BETWEEN form
$exclusionFrameExclusion|nullThe written exclusion
Calls 4
public function offsets(): list<Scalar>

Answers the offsets of the boundaries, in written order.

Returns

list<Scalar>
Test cases 1
public function render(Output $out): void

Writes the frame.

Parameters

$outOutput
Test cases 1
Calls 3

Test cases 4§

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

Dedicated tests 2
Other tests reaching this symbol 2

Relations§

Instantiated in 2
Type declarations 2