CakePHP
  • 文档
    • 手册
    • API
    • 视频
    • 报告安全问题
    • 隐私政策
    • 徽标和商标
  • 商业解决方案
  • 纪念品
  • 公路旅行
  • 团队
  • 社区
    • 社区
    • 参与
    • 问题 (Github)
    • 烘焙坊
    • 精选资源
    • 培训
    • 聚会
    • 我的 CakePHP
    • CakeFest
    • 时事通讯
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • 帮助和支持
    • 论坛
    • Stack Overflow
    • IRC
    • Slack
    • 付费支持
CakePHP

C CakePHP 5.1 Chiffon API

  • 项目
    • CakePHP
      • CakePHP
      • Chronos
      • Elastic Search
      • 队列
  • 版本
    • 5.1
      • 5.1
      • 5.0
      • 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

命名空间

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

类 WindowExpression

这表示聚合函数和窗口函数使用的 SQL 窗口表达式。

命名空间: Cake\Database\Expression

常量

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

属性概述

  • $exclusion protected
    string|null
  • $frame protected
    array|null
  • $name protected
    Cake\Database\Expression\IdentifierExpression
  • $order protected
    Cake\Database\Expression\OrderByExpression|null
  • $partitions protected
    array<Cake\Database\ExpressionInterface>

方法概述

  • __clone() public

    克隆此对象及其表达式子树。

  • __construct() public
  • buildOffsetSql() protected

    构建框架偏移量 SQL。

  • excludeCurrent() public

    添加当前行框架排除。

  • excludeGroup() public

    添加组框架排除。

  • excludeTies() public

    添加平局框架排除。

  • frame() public

    向窗口添加框架。

  • groups() public

    向窗口添加一个简单的组框架。

  • isNamedOnly() public

    返回是否仅是一个命名的窗口表达式。

  • name() public

    设置窗口名称。

  • order() public

    向窗口添加一个或多个 order by 子句。

  • orderBy() public

    向窗口添加一个或多个 order by 子句。

  • partition() public

    向窗口添加一个或多个分区表达式。

  • range() public

    向窗口添加一个简单的范围框架。

  • rows() public

    向窗口添加一个简单的行框架。

  • sql() public

    将节点转换为 SQL 字符串片段。

  • traverse() public

    递归地遍历表达式的每一部分,并对表达式树的每一级执行回调,将当前迭代的表达式的实例作为第一个参数传递。

方法详细说明

__clone() ¶ public

__clone(): void

克隆此对象及其表达式子树。

返回值
void

__construct() ¶ public

__construct(string $name = '')
参数
string $name 可选

窗口名称

buildOffsetSql() ¶ protected

buildOffsetSql(Cake\Database\ValueBinder $binder, Cake\Database\ExpressionInterface|string|int|null $offset, string $direction): string

构建框架偏移量 SQL。

参数
Cake\Database\ValueBinder $binder

值绑定器

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

框架偏移量

string $direction

框架偏移方向

返回值
string

excludeCurrent() ¶ public

excludeCurrent(): $this

添加当前行框架排除。

返回值
$this

excludeGroup() ¶ public

excludeGroup(): $this

添加组框架排除。

返回值
$this

excludeTies() ¶ public

excludeTies(): $this

添加平局框架排除。

返回值
$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

向窗口添加框架。

如果您需要简单的“BETWEEN offset PRECEDING 和 offset FOLLOWING”框架,请使用 range()、rows() 或 groups() 帮助器。

您可以为框架起点和框架终点指定任何方向。

对于 $startOffset 和 $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
返回值
$this

groups() ¶ public

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

向窗口添加一个简单的组框架。

有关详细信息,请参阅 range()。

参数
int|null $start
int|null $end 可选
返回值
$this

isNamedOnly() ¶ public

isNamedOnly(): bool

返回是否仅是一个命名的窗口表达式。

这些窗口表达式仅指定一个命名窗口,并未指定它们自己的分区、框架或排序。

返回值
bool

name() ¶ public

name(string $name): $this

设置窗口名称。

参数
string $name

窗口名称

返回值
$this

order() ¶ public

order(Cake\Database\ExpressionInterfaceClosure|arrayCake\Database\ExpressionInterface|string>|string $fields): $this

向窗口添加一个或多个 order by 子句。

参数
Cake\Database\ExpressionInterfaceClosure|array<Cake\Database\ExpressionInterface|string>|string $fields
返回值
$this

orderBy() ¶ public

orderBy(Cake\Database\ExpressionInterfaceClosure|arrayCake\Database\ExpressionInterface|string>|string $fields): $this

向窗口添加一个或多个 order by 子句。

参数
Cake\Database\ExpressionInterfaceClosure|array<Cake\Database\ExpressionInterface|string>|string $fields
返回值
$this

partition() ¶ public

partition(Cake\Database\ExpressionInterfaceClosure|arrayCake\Database\ExpressionInterface|string>|string $partitions): $this

向窗口添加一个或多个分区表达式。

参数
Cake\Database\ExpressionInterfaceClosure|array<Cake\Database\ExpressionInterface|string>|string $partitions
返回值
$this

range() ¶ public

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

如果您需要在框架起点使用“FOLLOWING”或在框架终点使用“PRECEDING”,请改为使用 frame()。

参数
Cake\Database\ExpressionInterface|string|int|null $start
Cake\Database\ExpressionInterface|string|int|null $end 可选
返回值
$this

rows() ¶ public

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

向窗口添加一个简单的行框架。

有关详细信息,请参阅 range()。

参数
int|null $start
int|null $end 可选
返回值
$this

sql() ¶ public

sql(Cake\Database\ValueBinder $binder): string

将节点转换为 SQL 字符串片段。

参数
Cake\Database\ValueBinder $binder
返回值
string

traverse() ¶ public

traverse(Closure $callback): $this

递归地遍历表达式的每一部分,并对表达式树的每一级执行回调,将当前迭代的表达式的实例作为第一个参数传递。

参数
Closure $callback
返回值
$this

属性详情

$exclusion ¶ protected

Type
string|null

$frame ¶ protected

Type
array|null

$name ¶ protected

Type
Cake\Database\Expression\IdentifierExpression

$order ¶ protected

Type
Cake\Database\Expression\OrderByExpression|null

$partitions ¶ protected

Type
array<Cake\Database\ExpressionInterface>
OpenHub
Pingping
Linode
  • 商业解决方案
  • 展示
  • 文档
  • 手册
  • API
  • 视频
  • 报告安全问题
  • 隐私政策
  • 徽标和商标
  • 社区
  • 参与
  • 问题 (Github)
  • 烘焙坊
  • 精选资源
  • 培训
  • 聚会
  • 我的 CakePHP
  • CakeFest
  • 时事通讯
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • 帮助和支持
  • 论坛
  • Stack Overflow
  • IRC
  • Slack
  • 付费支持

使用 CakePHP API 文档 生成