0 follower

Final Class Yiisoft\Db\Query\WithQuery

InheritanceYiisoft\Db\Query\WithQuery

Represents a common table expression (CTE) for SQL WITH queries.

A data structure holds the information for a single "WITH" query clause.

See also:

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Db\Query\WithQuery

Property Details

Hide inherited properties

$alias public property
$query public property
$recursive public property
public boolean $recursive false

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\Db\Query\QueryInterface|string $query, Yiisoft\Db\Expression\ExpressionInterface|string $alias, boolean $recursive false )
$query Yiisoft\Db\Query\QueryInterface|string

The query to be used as a CTE. It can be a Query object or a raw SQL string.

$alias Yiisoft\Db\Expression\ExpressionInterface|string

The name/alias for the CTE that can be referenced in the main query.

$recursive boolean

Whether this is a recursive CTE. Default is false.

                public function __construct(
    public readonly QueryInterface|string $query,
    public readonly ExpressionInterface|string $alias,
    public readonly bool $recursive = false,
) {}