This represents a SQL window expression used by aggregate and window functions.
string 'FOLLOWING'
string 'GROUPS'
string 'PRECEDING'
string 'RANGE'
string 'ROWS'
string|nullarray|nullCake\Database\Expression\IdentifierExpressionCake\Database\Expression\OrderByExpression|nullarrayCake\Database\ExpressionInterface>Clone this object and its subtree of expressions.
Builds frame offset sql.
Adds current row frame exclusion.
Adds group frame exclusion.
Adds ties frame exclusion.
Adds a frame to the window.
Adds a simple groups frame to the window.
Return whether is only a named window expression.
Sets the window name.
Adds one or more order clauses to the window.
Adds one or more partition expressions to the window.
Adds a simple range frame to the window.
Adds a simple rows frame to the window.
Converts the Node into a SQL string fragment.
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.
__clone(): void
Clone this object and its subtree of expressions.
void__construct(string $name = '')
string $name optional Window name
buildOffsetSql(Cake\Database\ValueBinder $binder, Cake\Database\ExpressionInterface|string|int|null $offset, string $direction): string
Builds frame offset sql.
Cake\Database\ValueBinder $binder Value binder
Cake\Database\ExpressionInterface|string|int|null $offset Frame offset
string $direction Frame offset direction
stringexcludeCurrent(): $this
Adds current row frame exclusion.
$thisexcludeGroup(): $this
Adds group frame exclusion.
$thisexcludeTies(): $this
Adds ties frame exclusion.
$thisframe(string $type, Cake\Database\ExpressionInterface|string|int|null $startOffset, string $startDirection, Cake\Database\ExpressionInterface|string|int|null $endOffset, string $endDirection): $this
Adds a frame to the window.
Use the range(), rows() or groups() helpers if you need simple 'BETWEEN offset PRECEDING and offset FOLLOWING' frames.
You can specify any direction for both frame start and frame end.
With both $startOffset and $endOffset:
0 - 'CURRENT ROW'null - 'UNBOUNDED'string $type Cake\Database\ExpressionInterface|string|int|null $startOffset string $startDirection Cake\Database\ExpressionInterface|string|int|null $endOffset string $endDirection $thisgroups(int|null $start, int|null $end = 0): $this
Adds a simple groups frame to the window.
See range() for details.
int|null $start int|null $end optional $thisisNamedOnly(): bool
Return whether is only a named window expression.
These window expressions only specify a named window and do not specify their own partitions, frame or order.
boolname(string $name): $this
Sets the window name.
string $name Window name
$thisorder(Cake\Database\ExpressionInterfaceClosure|arrayCake\Database\ExpressionInterface|string>|string $fields): $this
Adds one or more order clauses to the window.
Cake\Database\ExpressionInterfaceClosure|arrayCake\Database\ExpressionInterface|string>|string $fields $thispartition(Cake\Database\ExpressionInterfaceClosure|arrayCake\Database\ExpressionInterface|string>|string $partitions): $this
Adds one or more partition expressions to the window.
Cake\Database\ExpressionInterfaceClosure|arrayCake\Database\ExpressionInterface|string>|string $partitions $thisrange(Cake\Database\ExpressionInterface|string|int|null $start, Cake\Database\ExpressionInterface|string|int|null $end = 0): $this
Adds a simple range frame to the window.
$start:
0 - 'CURRENT ROW'null - 'UNBOUNDED PRECEDING'$end:
0 - 'CURRENT ROW'null - 'UNBOUNDED FOLLOWING'If you need to use 'FOLLOWING' with frame start or 'PRECEDING' with frame end, use frame() instead.
Cake\Database\ExpressionInterface|string|int|null $start Cake\Database\ExpressionInterface|string|int|null $end optional $thisrows(int|null $start, int|null $end = 0): $this
Adds a simple rows frame to the window.
See range() for details.
int|null $start int|null $end optional $thissql(Cake\Database\ValueBinder $binder): string
Converts the Node into a SQL string fragment.
Cake\Database\ValueBinder $binder stringtraverse(Closure $callback): $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.
Closure $callback $thisstring|nullarray|nullCake\Database\Expression\IdentifierExpressionCake\Database\Expression\OrderByExpression|nullarrayCake\Database\ExpressionInterface>
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.Database.Expression.WindowExpression.html