An expression that represents a common table expression definition.
\Cake\Database\Expression\IdentifierExpression[]
The field names to use for the CTE.
string|null
Whether the CTE is materialized or not materialized.
\Cake\Database\Expression\IdentifierExpression
The CTE name.
\Cake\Database\ExpressionInterface|null
The CTE query definition.
bool
Whether the CTE is recursive.
Iterates over each part of the expression recursively for every level of the expressions tree and executes the $visitor callable passing as first parameter the instance of the expression currently being iterated.
__clone()
Clones the inner expression objects.
__construct(string $name, mixed $query)
Constructor.
string
$name optional The CTE name.
\Closure|\Cake\Database\ExpressionInterface
$query optional CTE query
field(mixed $fields)
Adds one or more fields (arguments) to the CTE.
string|string[]|\Cake\Database\Expression\IdentifierExpression|\Cake\Database\Expression\IdentifierExpression[]
$fields Field names
$this
isRecursive()
Gets whether this CTE is recursive.
bool
materialized()
Sets this CTE as materialized.
$this
name(string $name)
Sets the name of this CTE.
This is the named you used to reference the expression in select, insert, etc queries.
string
$name The CTE name.
$this
notMaterialized()
Sets this CTE as not materialized.
$this
query(mixed $query)
Sets the query for this CTE.
\Closure|\Cake\Database\ExpressionInterface
$query CTE query
$this
recursive()
Sets this CTE as recursive.
$this
sql(\Cake\Database\ValueBinder $generator)
Converts the Node into a SQL string fragment.
\Cake\Database\ValueBinder
$generator Placeholder generator object
string
traverse(\Closure $visitor)
Iterates over each part of the expression recursively for every level of the expressions tree and executes the $visitor callable passing as first parameter the instance of the expression currently being iterated.
\Closure
$visitor The callable to apply to all nodes.
$this
The field names to use for the CTE.
\Cake\Database\Expression\IdentifierExpression[]
Whether the CTE is materialized or not materialized.
string|null
The CTE name.
\Cake\Database\Expression\IdentifierExpression
The CTE query definition.
\Cake\Database\ExpressionInterface|null
Whether the CTE is recursive.
bool
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Database.Expression.CommonTableExpression.html