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
    • 缓存
    • 集合
    • 命令
    • 控制台
    • 控制器
    • 核心
    • 数据库
      • 驱动程序
      • 异常
      • 表达式
      • 日志
      • 查询
      • 重试
      • 模式
      • 语句
      • 类型
    • 数据源
    • 错误
    • 事件
    • 表单
    • Http
    • 国际化
    • 日志
    • 邮件发送器
    • 网络
    • ORM
    • 路由
    • 测试套件
    • 实用工具
    • 验证
    • 视图

接口 WindowInterface

定义用于构建窗口表达式的函数。

命名空间: Cake\Database\Expression

常量

  • 字符串
    FOLLOWING ¶
    'FOLLOWING'
  • 字符串
    GROUPS ¶
    'GROUPS'
  • 字符串
    PRECEDING ¶
    'PRECEDING'
  • 字符串
    RANGE ¶
    'RANGE'
  • 字符串
    ROWS ¶
    'ROWS'

方法摘要

  • excludeCurrent() public

    添加当前行框排除。

  • excludeGroup() public

    添加组框排除。

  • excludeTies() public

    添加平局框排除。

  • frame() public

    向窗口添加一个框。

  • groups() public

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

  • order() public deprecated

    向窗口添加一个或多个排序子句。

  • orderBy() public

    向窗口添加一个或多个排序子句。

  • partition() public

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

  • range() public

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

  • rows() public

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

方法详细

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 and offset FOLLOWING”框,请使用range()、rows() 或 groups() 帮助程序。

您可以为框开始和框结束指定任何方向。

使用 $startOffset 和 $endOffset

  • 0 - “当前行”
  • null - “无界”
参数
字符串 $type

框类型

Cake\Database\ExpressionInterface|字符串|整数|null $startOffset

框开始偏移量

字符串 $startDirection

框开始方向

Cake\Database\ExpressionInterface|字符串|整数|null $endOffset

框结束偏移量

字符串 $endDirection

框结束方向

返回
$this
抛出
InvalidArgumentException
当偏移量为负数时。

groups() ¶ public

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

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

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

参数
整数|null $start

框开始

整数|null $end 可选

框结束 如果未传入,则仅生成框开始 SQL。

返回
$this

order() ¶ public

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

向窗口添加一个或多个排序子句。

参数
Cake\Database\ExpressionInterfaceClosure|数组Cake\Database\ExpressionInterface|字符串>|字符串 $fields

排序表达式

返回
$this

orderBy() ¶ public

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

向窗口添加一个或多个排序子句。

参数
Cake\Database\ExpressionInterfaceClosure|数组Cake\Database\ExpressionInterface|字符串>|字符串 $fields

排序表达式

返回
$this

partition() ¶ public

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

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

参数
Cake\Database\ExpressionInterfaceClosure|数组Cake\Database\ExpressionInterface|字符串>|字符串 $partitions

分区表达式

返回
$this

range() ¶ public

range(Cake\Database\ExpressionInterface|string|int|null $start, Cake\Database\ExpressionInterface|string|int|null $end = 0): $this

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

$start:

  • 0 - “当前行”
  • null - “无界 PRECEDING”
  • 偏移量 - “偏移量 PRECEDING”

$end:

  • 0 - “当前行”
  • null - “无界 FOLLOWING”
  • 偏移量 - “偏移量 FOLLOWING”

如果您需要将“FOLLOWING”与框开始一起使用,或将“PRECEDING”与框结束一起使用,请改用frame()。

参数
Cake\Database\ExpressionInterface|字符串|整数|null $start

框开始

Cake\Database\ExpressionInterface|字符串|整数|null $end 可选

框结束 如果未传入,则仅生成框开始 SQL。

返回
$this

rows() ¶ public

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

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

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

参数
整数|null $start

框开始

整数|null $end 可选

框结束 如果未传入,则仅生成框开始 SQL。

返回
$this
OpenHub
Pingping
Linode
  • 商业解决方案
  • 展示
  • 文档
  • 书籍
  • API
  • 视频
  • 报告安全问题
  • 隐私政策
  • 标识和商标
  • 社区
  • 参与
  • 问题 (Github)
  • 烘焙坊
  • 精选资源
  • 培训
  • 聚会
  • 我的 CakePHP
  • CakeFest
  • 新闻稿
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • 帮助和支持
  • 论坛
  • Stack Overflow
  • IRC
  • Slack
  • 付费支持

使用 CakePHP API Docs 生成