final class ResolvedColumn
    implements Resolution
    uses Snapshot
Public API: explicitly declared with @visibility public.

A name that resolves to exactly one output slot of one relation occurrence.

Reaching the occurrence and the supplied declarationdoctest
$semantics = new \SqlSemantics\Platform\MySql\Semantics();
    $table = $semantics->analyze('CREATE TABLE t (a INTEGER)');
    $query = $semantics->analyze('SELECT a FROM t', [$table]);
    $resolution = $query->field('a')->resolution;
    [$resolution->relation === $query->inputRelation(), $resolution->declaration() === $table->declarations()[0]->columns[0], $resolution->depth] // => [true, true, 0]

Properties§

public Relation $relation
public OutputSlot $slot
public int $depth = 0

Methods§

public function __construct(
    public Relation $relation,
    public OutputSlot $slot,
    public int $depth = 0,
)

Parameters

$relationRelationThe relation occurrence the name was found in
$slotOutputSlotThe output slot of that occurrence
$depthintHow many enclosing queries lie between the use and the occurrence; zero for the same query
Calls 1
public function declaration(): ?Column

Answers the declared column, when the slot is one.

Returns

Calls 1

Test cases 44§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Other tests reaching this symbol 44

Relations§

Instantiated in 6
Constant reads 2
Type checks 14
Type declarations 6