|string $partitions Partition expressions * @return $this */ public function partition($partitions); /** * Adds one or more order clauses to the window. * * @param \Cake\Database\ExpressionInterface|\Closure|array<\Cake\Database\ExpressionInterface|string>|string $fields Order expressions * @return $this */ public function order($fields); /** * Adds a simple range frame to the window. * * `$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. * * @param \Cake\Database\ExpressionInterface|string|int|null $start Frame start * @param \Cake\Database\ExpressionInterface|string|int|null $end Frame end * If not passed in, only frame start SQL will be generated. * @return $this */ public function range($start, $end = 0); /** * Adds a simple rows frame to the window. * * See `range()` for details. * * @param int|null $start Frame start * @param int|null $end Frame end * If not passed in, only frame start SQL will be generated. * @return $this */ public function rows(?int $start, ?int $end = 0); /** * Adds a simple groups frame to the window. * * See `range()` for details. * * @param int|null $start Frame start * @param int|null $end Frame end * If not passed in, only frame start SQL will be generated. * @return $this */ public function groups(?int $start, ?int $end = 0); /** * 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' * * @param string $type Frame type * @param \Cake\Database\ExpressionInterface|string|int|null $startOffset Frame start offset * @param string $startDirection Frame start direction * @param \Cake\Database\ExpressionInterface|string|int|null $endOffset Frame end offset * @param string $endDirection Frame end direction * @return $this * @throws \InvalidArgumentException WHen offsets are negative. * @psalm-param self::RANGE|self::ROWS|self::GROUPS $type * @psalm-param self::PRECEDING|self::FOLLOWING $startDirection * @psalm-param self::PRECEDING|self::FOLLOWING $endDirection */ public function frame( string $type, $startOffset, string $startDirection, $endOffset, string $endDirection ); /** * Adds current row frame exclusion. * * @return $this */ public function excludeCurrent(); /** * Adds group frame exclusion. * * @return $this */ public function excludeGroup(); /** * Adds ties frame exclusion. * * @return $this */ public function excludeTies(); }