CakePHP
  • 文档
    • 手册
    • API
    • 视频
    • 报告安全问题
    • 隐私政策
    • 标识和商标
  • 商业解决方案
  • 纪念品
  • 公路旅行
  • 团队
  • 社区
    • 社区
    • 参与
    • 问题 (Github)
    • Bakery
    • 精选资源
    • 培训
    • 聚会
    • 我的 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

类 QueryFactory

用于生成 Select、Insert、Update、Delete 查询实例的工厂类。

命名空间: Cake\Database\Query

方法摘要

  • __construct() public

    构造函数/

  • delete() public

    创建一个新的 DeleteQuery 实例。

  • insert() public

    创建一个新的 InsertQuery 实例。

  • select() public

    创建一个新的 SelectQuery 实例。

  • update() public

    创建一个新的 UpdateQuery 实例。

方法详情

__construct() ¶ public

__construct(Cake\Database\Connection $connection)

构造函数/

参数
Cake\Database\Connection $connection

连接实例。

delete() ¶ public

delete(string|null $table = null, array $conditions = [], array<string, string> $types = []): Cake\Database\Query\DeleteQuery

创建一个新的 DeleteQuery 实例。

参数
string|null $table optional

要从中删除行的表。

array $conditions optional

要为删除语句设置的条件。

array<string, string> $types optional

包含用于转换类型的关联数组。

返回值
Cake\Database\Query\DeleteQuery

insert() ¶ public

insert(string|null $table = null, array $values = [], array<int|string, string> $types = []): Cake\Database\Query\InsertQuery

创建一个新的 InsertQuery 实例。

参数
string|null $table optional

要插入行的表。

array $values optional

要插入的列 => 值的关联数组。

array<int|string, string> $types optional

包含用于转换类型的关联数组。

返回值
Cake\Database\Query\InsertQuery

select() ¶ public

select(Cake\Database\ExpressionInterfaceClosure|array|string|float|int $fields = [], array|string $table = [], array<string, string> $types = []): Cake\Database\Query\SelectQuery

创建一个新的 SelectQuery 实例。

参数
Cake\Database\ExpressionInterfaceClosure|array|string|float|int $fields optional

查询的字段/列列表。

array|string $table optional

要查询的表列表。

array<string, string> $types optional

包含用于转换类型的关联数组。

返回值
Cake\Database\Query\SelectQuery

update() ¶ public

update(Cake\Database\ExpressionInterface|string|null $table = null, array $values = [], array $conditions = [], array<string, string> $types = []): Cake\Database\Query\UpdateQuery

创建一个新的 UpdateQuery 实例。

参数
Cake\Database\ExpressionInterface|string|null $table optional

要更新行的表。

array $values optional

要更新的值。

array $conditions optional

要为更新语句设置的条件。

array<string, string> $types optional

包含用于转换类型的关联数组。

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

使用 CakePHP API 文档 生成