final class ModelSet
Public API: explicitly declared with @visibility public.

Call transformations, statement compilers and type relations registered by enabled extensions.

Registering a function that returns a SQL fragmentdoctest
$models = new \SqlCatalog\Core\Extension\Model\ModelSet(calls: [
        static fn (\SqlCatalog\Core\Extension\Model\CallContext $call): ?\SqlCatalog\Core\Evaluation\Domain =>
            $call->name === 'today_sql' ? \SqlCatalog\Core\Evaluation\Domain::literal('CURRENT_DATE') : null,
    ]);
    count($models->calls) // => 1

Properties§

public list<Closure(CallContext): ?Domain> $calls = []
public array<string, QueryModelInterface> $queries = []
public list<Closure(string, string): bool> $classRelations = []

Methods§

public function __construct(
    public list<Closure(CallContext): ?Domain> $calls = [],
    public array<string, QueryModelInterface> $queries = [],
    public list<Closure(string, string): bool> $classRelations = [],
)

Parameters

$callslist<Closure(CallContext): ?Domain>Registered with the shared function-model registry; later registrations take priority.
$queriesarray<string, QueryModelInterface>Statement models keyed by SinkSpec::model.
$classRelationslist<Closure(string, string): bool>Additional known subtype relations.
public function merge(self $other): self

Combines registrations in extension order; later statement keys replace earlier ones.

Parameters

$otherself

Returns

self
Test cases 1
Calls 2
public function matchesClass(string $class, string $expected): bool

Whether an extension declares a subtype relation absent from application source.

Parameters

$classstring
$expectedstring

Returns

bool
Test cases 1

Test cases 11§

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

Dedicated tests 2
Other tests reaching this symbol 9

Relations§

Instantiated in 1
Type declarations 4