final class GenerationRun<TValue>

The rows produced while one plan is being walked, and what was learnt about them on the way.

Whether a table reads back as a list is decided by how the walk reached it, not by the relation on its own: the table a plan is about is one row even when something else references it.

Methods§

public function __construct(private array<string, RowSpec> $specs)

Parameters

$specsarray<string, RowSpec>
public function hasVisited(string $table): bool

Reports whether the current generation walk has reached or claimed a table.

Parameters

$tablestring

Returns

bool
Test cases 2
Called from 1
public function wasAskedFor(string $table): bool

Whether the caller said anything about this table.

Parameters

$tablestring

Returns

bool
Test cases 1
Called from 1
public function record(
    TableSchema $schema,
    array<string, TValue> $row,
    list<string> $referencedColumns = [],
): array<string, TValue|int>

Keep a row, standing in for the keys a database would have assigned where a relation needs to read them.

Only the columns something references are filled. A row nothing points at reads back the way fixture() has always returned one, with the auto-increment column absent because the database supplies it.

Parameters

$schemaTableSchema
$rowarray<string, TValue>
$referencedColumnslist<string>Columns a relation reads off this table

Returns

array<string, TValue|int>
Test cases 9
Called from 1
Calls 3
public function lastRow(string $table): array<string, TValue|int>

The row most recently kept for a table, which is the one a relation walked into it will read its key from.

Parameters

$tablestring

Returns

array<string, TValue|int>
Test cases 3
Called from 1
Calls 1

Private surface 3§

Implementation details, listed for orientation only.

private array<string, list<array<string, TValue|int>>> $rows = []
private array<string, bool> $visited = []
private array<string, RowSpec> $specs

Test cases 28§

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

Dedicated tests 16
Other tests reaching this symbol 12

Relations§

Instantiated in 1
Method calls 10
Type declarations 5