classParentKeyLookup
final class ParentKeyLookup
Reports whether the row a foreign key points at is still there.
A cascade is only set off where nothing else holds the key up. Another row of the parent may carry the same values — the key need not be unique — and while one does, the children still reference something that exists.
Type Aliases§
RowValue = import from TableDefinitionMethods§
public function __construct(private RowMatch $rows = new \ZtdQuery\Shadow\Row\RowMatch())Parameters
$rows | RowMatch | Finds a row among rows |
Test cases 4
public function exists(
ShadowStore $store,
string $table,
list<string> $columns,
list<RowValue> $values,
): boolReports whether some row of the parent still carries these values.
Parameters
$store | ShadowStore | Shadow to look in |
$table | string | Parent table |
$columns | list<string> | Parent columns the key points at |
$values | list<RowValue> | Values the child references |
Returns
bool True when a parent row still carries themTest cases 4
ParentKeyLookupTest::testDoesNotExistWhenNoRowCarriesTheValuescovers and callsParentKeyLookupTest::testDoesNotExistWhenTheTableHasNoRowsAtAllcovers and callsParentKeyLookupTest::testExistsOnlyWhenOneRowCarriesEveryColumnOfACompositeKeycovers and callsParentKeyLookupTest::testExistsWhenSomeRowStillCarriesTheValuescovers and calls
Called from 3
- method-call ZtdQuery\Shadow\ForeignKeyCascade::carryUpdate() packages/ztd-query-core/src/Shadow/ForeignKeyCascade.php:115
- method-call ZtdQuery\Shadow\ForeignKeyCascade::carryDelete() packages/ztd-query-core/src/Shadow/ForeignKeyCascade.php:149
- method-call ZtdQuery\Shadow\ForeignKeyIntegrity::assertHolds() packages/ztd-query-core/src/Shadow/ForeignKeyIntegrity.php:57
Calls 2
- method-call ShadowStore::get() line 40
- method-call RowMatch::carries() line 41
Private surface 1§
Implementation details, listed for orientation only.
private RowMatch $rows = new \ZtdQuery\Shadow\Row\RowMatch()Test cases 10§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
ParentKeyLookupTest::testDoesNotExistWhenNoRowCarriesTheValuescovers and callsParentKeyLookupTest::testDoesNotExistWhenTheTableHasNoRowsAtAllcovers and callsParentKeyLookupTest::testExistsOnlyWhenOneRowCarriesEveryColumnOfACompositeKeycovers and callsParentKeyLookupTest::testExistsWhenSomeRowStillCarriesTheValuescovers and calls
Other tests reaching this symbol 6
SessionTestcallsForeignKeyCascadeTestcallsForeignKeyIntegrityTestcallsReferentialIntegrityEnforcerTestcallsShadowApplicationTestcallsStatementSimulatorTestcalls
Relations§
Instantiated in 2
Method calls 3
- method-call ZtdQuery\Shadow\ForeignKeyCascade::carryUpdate() packages/ztd-query-core/src/Shadow/ForeignKeyCascade.php:115
- method-call ZtdQuery\Shadow\ForeignKeyCascade::carryDelete() packages/ztd-query-core/src/Shadow/ForeignKeyCascade.php:149
- method-call ZtdQuery\Shadow\ForeignKeyIntegrity::assertHolds() packages/ztd-query-core/src/Shadow/ForeignKeyIntegrity.php:57