classModelSet
final class ModelSet
Public API: explicitly declared with
@visibility public.Call transformations, statement compilers and type relations registered by enabled extensions.
$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) // => 1Properties§
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
$calls | list<Closure(CallContext): ?Domain> | Registered with the shared function-model registry; later registrations take priority. |
$queries | array<string, QueryModelInterface> | Statement models keyed by SinkSpec::model. |
$classRelations | list<Closure(string, string): bool> | Additional known subtype relations. |
public function merge(self $other): selfCombines registrations in extension order; later statement keys replace earlier ones.
Parameters
$other | self |
Returns
selfTest cases 1
public function matchesClass(string $class, string $expected): boolWhether an extension declares a subtype relation absent from application source.
Parameters
$class | string | |
$expected | string |
Returns
boolTest 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
CallbackEffectsTestcallsSinkMatcherTest::testClassMatchesUsesRegisteredTypeRelationsOnlycallsBuilderQueriesTestcallsCallbackModelTestcallsCallModelTestcallsLaravelExtensionTestcallsAnalyzerTest::testAnalyzeSourceAllowsExtensionsToModelSqlFragmentsFromAnyCallFormcallsAnalyzerTest::testAnalyzeSourceLetsRegisteredCallModelsOwnTheirArgumentEffectscallsAnalyzerTest::testAnalyzeSourceSupportsRegisteredQueryModelsWithoutLaravelcalls
Relations§
Instantiated in 1
Type declarations 4
- type SqlCatalog\Core\Analysis\Interpreter packages/sql-catalog/src/Core/Analysis/Interpreter.php:73
- type SqlCatalog\Core\Analysis\SinkMatcher packages/sql-catalog/src/Core/Analysis/SinkMatcher.php:30
- type SqlCatalog\Core\Extension\Model\ModelProviderInterface packages/sql-catalog/src/Core/Extension/Model/ModelProviderInterface.php:32
- type SqlCatalog\Extension\Laravel\LaravelExtension packages/sql-catalog/src/Extension/Laravel/LaravelExtension.php:96