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

Class CommonTableExpression

An expression that represents a common table expression definition.

Namespace: Cake\Database\Expression

Property Summary

  • $fields protected
    array<Cake\Database\Expression\IdentifierExpression>

    The field names to use for the CTE.

  • $materialized protected
    string|null

    Whether the CTE is materialized or not materialized.

  • $name protected
    Cake\Database\Expression\IdentifierExpression

    The CTE name.

  • $query protected
    Cake\Database\ExpressionInterface|null

    The CTE query definition.

  • $recursive protected
    bool

    Whether the CTE is recursive.

Method Summary

  • __clone() public

    Clones the inner expression objects.

  • __construct() public

    Constructor.

  • field() public

    Adds one or more fields (arguments) to the CTE.

  • isRecursive() public

    Gets whether this CTE is recursive.

  • materialized() public

    Sets this CTE as materialized.

  • name() public

    Sets the name of this CTE.

  • notMaterialized() public

    Sets this CTE as not materialized.

  • query() public

    Sets the query for this CTE.

  • recursive() public

    Sets this CTE as recursive.

  • sql() public

    Converts the Node into a SQL string fragment.

  • traverse() public

    Iterates over each part of the expression recursively for every level of the expressions tree and executes the $callback callable passing as first parameter the instance of the expression currently being iterated.

Method Detail

__clone() ¶ public

__clone(): void

Clones the inner expression objects.

Returns
void

__construct() ¶ public

__construct(string $name = '', Cake\Database\ExpressionInterface|Closure $query = null)

Constructor.

Parameters
string $name optional

The CTE name.

Cake\Database\ExpressionInterface|Closure $query optional

CTE query

field() ¶ public

field(Cake\Database\Expression\IdentifierExpression|array<Cake\Database\Expression\IdentifierExpression>|array<string>|string $fields): $this

Adds one or more fields (arguments) to the CTE.

Parameters
Cake\Database\Expression\IdentifierExpression|array<Cake\Database\Expression\IdentifierExpression>|array<string>|string $fields

Field names

Returns
$this

isRecursive() ¶ public

isRecursive(): bool

Gets whether this CTE is recursive.

Returns
bool

materialized() ¶ public

materialized(): $this

Sets this CTE as materialized.

Returns
$this

name() ¶ public

name(string $name): $this

Sets the name of this CTE.

This is the named you used to reference the expression in select, insert, etc queries.

Parameters
string $name

The CTE name.

Returns
$this

notMaterialized() ¶ public

notMaterialized(): $this

Sets this CTE as not materialized.

Returns
$this

query() ¶ public

query(Cake\Database\ExpressionInterface|Closure $query): $this

Sets the query for this CTE.

Parameters
Cake\Database\ExpressionInterface|Closure $query

CTE query

Returns
$this

recursive() ¶ public

recursive(): $this

Sets this CTE as recursive.

Returns
$this

sql() ¶ public

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

Converts the Node into a SQL string fragment.

Parameters
Cake\Database\ValueBinder $binder
Returns
string

traverse() ¶ public

traverse(Closure $callback): $this

Iterates over each part of the expression recursively for every level of the expressions tree and executes the $callback callable passing as first parameter the instance of the expression currently being iterated.

Parameters
Closure $callback
Returns
$this

Property Detail

$fields ¶ protected

The field names to use for the CTE.

Type
array<Cake\Database\Expression\IdentifierExpression>

$materialized ¶ protected

Whether the CTE is materialized or not materialized.

Type
string|null

$name ¶ protected

The CTE name.

Type
Cake\Database\Expression\IdentifierExpression

$query ¶ protected

The CTE query definition.

Type
Cake\Database\ExpressionInterface|null

$recursive ¶ protected

Whether the CTE is recursive.

Type
bool
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