An expression that represents a common table expression definition.
arrayCake\Database\Expression\IdentifierExpression>The field names to use for the CTE.
string|nullWhether the CTE is materialized or not materialized.
Cake\Database\Expression\IdentifierExpressionThe CTE name.
Cake\Database\ExpressionInterface|nullThe CTE query definition.
boolWhether the CTE is recursive.
Clones the inner expression objects.
Constructor.
Adds one or more fields (arguments) to the CTE.
Gets whether this CTE is recursive.
Sets this CTE as materialized.
Sets the name of this CTE.
Sets this CTE as not materialized.
Sets the query for this CTE.
Sets this CTE as recursive.
Converts the Node into a SQL string fragment.
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.
__clone(): void
Clones the inner expression objects.
void__construct(string $name = '', Cake\Database\ExpressionInterfaceClosure $query = null)
Constructor.
string $name optional The CTE name.
Cake\Database\ExpressionInterfaceClosure $query optional CTE query
field(Cake\Database\Expression\IdentifierExpression|arrayCake\Database\Expression\IdentifierExpression>|array<string>|string $fields): $this
Adds one or more fields (arguments) to the CTE.
Cake\Database\Expression\IdentifierExpression|arrayCake\Database\Expression\IdentifierExpression>|array<string>|string $fields Field names
$thisisRecursive(): bool
Gets whether this CTE is recursive.
boolmaterialized(): $this
Sets this CTE as materialized.
$thisname(string $name): $this
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.
$thisnotMaterialized(): $this
Sets this CTE as not materialized.
$thisquery(Cake\Database\ExpressionInterfaceClosure $query): $this
Sets the query for this CTE.
Cake\Database\ExpressionInterfaceClosure $query CTE query
$thisrecursive(): $this
Sets this CTE as recursive.
$thissql(Cake\Database\ValueBinder $binder): string
Converts the Node into a SQL string fragment.
Cake\Database\ValueBinder $binder stringtraverse(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.
Closure $callback $thisThe field names to use for the CTE.
arrayCake\Database\Expression\IdentifierExpression>Whether the CTE is materialized or not materialized.
string|nullThe CTE name.
Cake\Database\Expression\IdentifierExpressionThe CTE query definition.
Cake\Database\ExpressionInterface|nullWhether 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.4/class-Cake.Database.Expression.CommonTableExpression.html