Fr3nch13/CakePHP Utilities

CommonTableExpression
in package
implements ExpressionInterface

An expression that represents a common table expression definition.

Table of Contents

Interfaces

ExpressionInterface
An interface used by Expression objects.

Properties

$fields  : array<string|int, IdentifierExpression>
The field names to use for the CTE.
$materialized  : string|null
Whether the CTE is materialized or not materialized.
$name  : IdentifierExpression
The CTE name.
$query  : ExpressionInterface|null
The CTE query definition.
$recursive  : bool
Whether the CTE is recursive.

Methods

__clone()  : void
Clones the inner expression objects.
__construct()  : mixed
Constructor.
field()  : $this
Adds one or more fields (arguments) to the CTE.
isRecursive()  : bool
Gets whether this CTE is recursive.
materialized()  : $this
Sets this CTE as materialized.
name()  : $this
Sets the name of this CTE.
notMaterialized()  : $this
Sets this CTE as not materialized.
query()  : $this
Sets the query for this CTE.
recursive()  : $this
Sets this CTE as recursive.
sql()  : string
Converts the Node into a SQL string fragment.
traverse()  : $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.

Properties

$materialized

Whether the CTE is materialized or not materialized.

protected string|null $materialized = null

Methods

isRecursive()

Gets whether this CTE is recursive.

public isRecursive() : bool
Return values
bool

materialized()

Sets this CTE as materialized.

public materialized() : $this
Return values
$this

name()

Sets the name of this CTE.

public name(string $name) : $this

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

Parameters
$name : string

The CTE name.

Return values
$this

notMaterialized()

Sets this CTE as not materialized.

public notMaterialized() : $this
Return values
$this

sql()

Converts the Node into a SQL string fragment.

public sql(ValueBinder $binder) : string
Parameters
$binder : ValueBinder

Parameter binder

Tags
inheritDoc
Return values
string

traverse()

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.

public traverse(Closure $callback) : $this
Parameters
$callback : Closure

The callable to apply to all nodes.

Tags
inheritDoc
Return values
$this

        
On this page

Search results