WindowInterface
in
This defines the functions used for building window expressions.
Table of Contents
Constants
Methods
- excludeCurrent() : $this
- Adds current row frame exclusion.
- excludeGroup() : $this
- Adds group frame exclusion.
- excludeTies() : $this
- Adds ties frame exclusion.
- frame() : $this
- Adds a frame to the window.
- groups() : $this
- Adds a simple groups frame to the window.
- order() : $this
- Adds one or more order clauses to the window.
- partition() : $this
- Adds one or more partition expressions to the window.
- range() : $this
- Adds a simple range frame to the window.
- rows() : $this
- Adds a simple rows frame to the window.
Constants
FOLLOWING
public
string
FOLLOWING
= 'FOLLOWING'
GROUPS
public
string
GROUPS
= 'GROUPS'
PRECEDING
public
string
PRECEDING
= 'PRECEDING'
RANGE
public
string
RANGE
= 'RANGE'
ROWS
public
string
ROWS
= 'ROWS'
Methods
excludeCurrent()
Adds current row frame exclusion.
public
excludeCurrent() : $this
Return values
$thisexcludeGroup()
Adds group frame exclusion.
public
excludeGroup() : $this
Return values
$thisexcludeTies()
Adds ties frame exclusion.
public
excludeTies() : $this
Return values
$thisframe()
Adds a frame to the window.
public
frame(string $type, ExpressionInterface|string|int|null $startOffset, string $startDirection, ExpressionInterface|string|int|null $endOffset, string $endDirection) : $this
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'
Parameters
- $type : string
-
Frame type
- $startOffset : ExpressionInterface|string|int|null
-
Frame start offset
- $startDirection : string
-
Frame start direction
- $endOffset : ExpressionInterface|string|int|null
-
Frame end offset
- $endDirection : string
-
Frame end direction
Tags
Return values
$thisgroups()
Adds a simple groups frame to the window.
public
groups(int|null $start[, int|null $end = 0 ]) : $this
See range()
for details.
Parameters
- $start : int|null
-
Frame start
- $end : int|null = 0
-
Frame end If not passed in, only frame start SQL will be generated.
Return values
$thisorder()
Adds one or more order clauses to the window.
public
order(ExpressionInterface|Closure|array<string|int, ExpressionInterface|string>|string $fields) : $this
Parameters
- $fields : ExpressionInterface|Closure|array<string|int, ExpressionInterface|string>|string
-
Order expressions
Return values
$thispartition()
Adds one or more partition expressions to the window.
public
partition(ExpressionInterface|Closure|array<string|int, ExpressionInterface|string>|string $partitions) : $this
Parameters
- $partitions : ExpressionInterface|Closure|array<string|int, ExpressionInterface|string>|string
-
Partition expressions
Return values
$thisrange()
Adds a simple range frame to the window.
public
range(ExpressionInterface|string|int|null $start[, ExpressionInterface|string|int|null $end = 0 ]) : $this
$start
:
-
0
- 'CURRENT ROW' -
null
- 'UNBOUNDED PRECEDING' - offset - 'offset PRECEDING'
$end
:
-
0
- 'CURRENT ROW' -
null
- 'UNBOUNDED FOLLOWING' - offset - 'offset FOLLOWING'
If you need to use 'FOLLOWING' with frame start or
'PRECEDING' with frame end, use frame()
instead.
Parameters
- $start : ExpressionInterface|string|int|null
-
Frame start
- $end : ExpressionInterface|string|int|null = 0
-
Frame end If not passed in, only frame start SQL will be generated.
Return values
$thisrows()
Adds a simple rows frame to the window.
public
rows(int|null $start[, int|null $end = 0 ]) : $this
See range()
for details.
Parameters
- $start : int|null
-
Frame start
- $end : int|null = 0
-
Frame end If not passed in, only frame start SQL will be generated.