CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 4.4 Strawberry API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 4.4
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
      • Driver
      • Exception
      • Expression
      • Log
      • Retry
      • Schema
      • Statement
      • Type
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Interface WindowInterface

This defines the functions used for building window expressions.

Namespace: Cake\Database\Expression

Constants

  • string
    FOLLOWING ¶
    'FOLLOWING'
  • string
    GROUPS ¶
    'GROUPS'
  • string
    PRECEDING ¶
    'PRECEDING'
  • string
    RANGE ¶
    'RANGE'
  • string
    ROWS ¶
    'ROWS'

Method Summary

  • excludeCurrent() public

    Adds current row frame exclusion.

  • excludeGroup() public

    Adds group frame exclusion.

  • excludeTies() public

    Adds ties frame exclusion.

  • frame() public

    Adds a frame to the window.

  • groups() public

    Adds a simple groups frame to the window.

  • order() public

    Adds one or more order clauses to the window.

  • partition() public

    Adds one or more partition expressions to the window.

  • range() public

    Adds a simple range frame to the window.

  • rows() public

    Adds a simple rows frame to the window.

Method Detail

excludeCurrent() ¶ public

excludeCurrent(): $this

Adds current row frame exclusion.

Returns
$this

excludeGroup() ¶ public

excludeGroup(): $this

Adds group frame exclusion.

Returns
$this

excludeTies() ¶ public

excludeTies(): $this

Adds ties frame exclusion.

Returns
$this

frame() ¶ public

frame(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'
Parameters
string $type

Frame type

Cake\Database\ExpressionInterface|string|int|null $startOffset

Frame start offset

string $startDirection

Frame start direction

Cake\Database\ExpressionInterface|string|int|null $endOffset

Frame end offset

string $endDirection

Frame end direction

Returns
$this
Throws
InvalidArgumentException
WHen offsets are negative.

groups() ¶ public

groups(int|null $start, int|null $end = 0): $this

Adds a simple groups frame to the window.

See range() for details.

Parameters
int|null $start

Frame start

int|null $end optional

Frame end If not passed in, only frame start SQL will be generated.

Returns
$this

order() ¶ public

order(Cake\Database\ExpressionInterface|Closure|array<Cake\Database\ExpressionInterface|string>|string $fields): $this

Adds one or more order clauses to the window.

Parameters
Cake\Database\ExpressionInterface|Closure|array<Cake\Database\ExpressionInterface|string>|string $fields

Order expressions

Returns
$this

partition() ¶ public

partition(Cake\Database\ExpressionInterface|Closure|array<Cake\Database\ExpressionInterface|string>|string $partitions): $this

Adds one or more partition expressions to the window.

Parameters
Cake\Database\ExpressionInterface|Closure|array<Cake\Database\ExpressionInterface|string>|string $partitions

Partition expressions

Returns
$this

range() ¶ public

range(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'
  • 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
Cake\Database\ExpressionInterface|string|int|null $start

Frame start

Cake\Database\ExpressionInterface|string|int|null $end optional

Frame end If not passed in, only frame start SQL will be generated.

Returns
$this

rows() ¶ public

rows(int|null $start, int|null $end = 0): $this

Adds a simple rows frame to the window.

See range() for details.

Parameters
int|null $start

Frame start

int|null $end optional

Frame end If not passed in, only frame start SQL will be generated.

Returns
$this
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs