classRowMaterializer
final class RowMaterializer
Walks the relations needed to materialize one connected fixture group.
Methods§
public function __construct(
private SchemaResolverInterface $schemas,
private RowGeneration $generator,
private Generator $faker,
)Uses one schema registry, row generator and random source for the walk.
Parameters
$schemas | SchemaResolverInterface | |
$generator | RowGeneration | |
$faker | Generator |
public function materialize(
FixturePlan $plan,
string $table,
array<mixed> $inherited,
int $count,
bool $isList,
?Relation $arrivedBy,
GenerationRun $run,
): voidParameters
$plan | FixturePlan | |
$table | string | |
$inherited | array<mixed> | Columns already fixed by the relation walked in on |
$count | int | |
$isList | bool | |
$arrivedBy | ?Relation | |
$run | GenerationRun |
Test cases 1
Called from 3
- method-call SqlFixture\Fixture\Generation\RowMaterializer::materializeParent() packages/sql-fixture/src/Fixture/Generation/RowMaterializer.php:66
- method-call SqlFixture\Fixture\Generation\RowMaterializer::toChildren() packages/sql-fixture/src/Fixture/Generation/RowMaterializer.php:154
- method-call SqlFixture\Fixture\PlanGenerator::generate() packages/sql-fixture/src/Fixture/PlanGenerator.php:56
Calls 4
- method-call GenerationRun::reached() line 44
- method-call SchemaResolverInterface::resolve() line 46
- method-call GenerationRun::specFor() line 47
- method-call RowMaterializer::materializeRow() line 50
public function materializeParent(
FixturePlan $plan,
string $table,
bool $isList,
Relation $arrivedBy,
GenerationRun $run,
): array<string, mixed>Generate the single row a relation points at.
Parameters
$plan | FixturePlan | |
$table | string | |
$isList | bool | |
$arrivedBy | Relation | |
$run | GenerationRun |
Returns
array<string, mixed>Called from 1
Calls 2
- method-call RowMaterializer::materialize() line 66
- method-call GenerationRun::lastRow() line 68
public function materializeRow(
FixturePlan $plan,
TableSchema $schema,
array<mixed> $inherited,
RowSpec $spec,
int $index,
bool $isList,
?Relation $arrivedBy,
GenerationRun $run,
): voidParameters
$plan | FixturePlan | |
$schema | TableSchema | |
$inherited | array<mixed> | |
$spec | RowSpec | |
$index | int | |
$isList | bool | |
$arrivedBy | ?Relation | |
$run | GenerationRun |
Test cases 1
Called from 1
Calls 10
- method-call RowSpec::overridesFor() line 84
- method-call FixturePlan::dependenciesOf() line 87
- function-call
array_mergeline 92 - method-call RowMaterializer::toParent() line 92
- method-call GenerationRun::record() line 97
- method-call RowGeneration::generate() line 99
- method-call RelationProjection::referencedColumns() line 100
- new RelationProjection line 100
- method-call FixturePlan::dependentsOf() line 103
- method-call RowMaterializer::toChildren() line 108
public function toParent(
FixturePlan $plan,
Relation $relation,
array<mixed> $overrides,
bool $isList,
GenerationRun $run,
): array<string, mixed>Generate the one row this one references and read the linking columns off it.
Where the caller has already fixed every linking column they have said what the row references, so no parent is invented to contradict them.
Parameters
$plan | FixturePlan | |
$relation | Relation | |
$overrides | array<mixed> | |
$isList | bool | |
$run | GenerationRun |
Returns
array<string, mixed>Test cases 1
Called from 1
Calls 7
- method-call RelationProjection::isAlreadyLinked() line 129
- new RelationProjection line 129
- method-call Relation::parentIsOptional() line 133
- method-call GenerationRun::wasAskedFor() line 133
- method-call Relation::parent() line 133
- method-call RowMaterializer::materializeParent() line 137
- method-call RelationProjection::project() line 139
public function toChildren(
FixturePlan $plan,
Relation $relation,
array<string, mixed> $row,
bool $isList,
GenerationRun $run,
): voidParameters
$plan | FixturePlan | |
$relation | Relation | |
$row | array<string, mixed> | |
$isList | bool | |
$run | GenerationRun |
Test cases 1
Called from 1
Calls 8
- method-call Relation::child() line 152
- method-call RowMaterializer::materialize() line 154
- method-call RelationProjection::project() line 157
- new RelationProjection line 157
- method-call RelationCounts::resolveCount() line 158
- new RelationCounts line 158
- method-call GenerationRun::specFor() line 158
- method-call Relation::childIsCollection() line 159
Private surface 3§
Implementation details, listed for orientation only.
private SchemaResolverInterface $schemasprivate RowGeneration $generatorprivate Generator $fakerTest cases 10§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
RowMaterializerTest::testMaterializeLinksEveryChildToTheGeneratedParentcallsRowMaterializerTest::testMaterializeParentDoesNotWalkBackAlongTheArrivalRelationcallsRowMaterializerTest::testMaterializeRowPreservesExplicitKeyscallsRowMaterializerTest::testToChildrenCopiesTheExistingParentKeycallsRowMaterializerTest::testToParentProjectsGeneratedKeyscalls
Other tests reaching this symbol 5
PostgreSqlEndToEndTestcallsSqliteIntegrationTestcallsPlanGeneratorTestcallsFixtureProviderTestcallsSqlSchemaProviderTestcalls