classRowMultiset
final class RowMultiset
Rows counted with their repeats: what one set of rows has that another does not.
A table may hold the same row twice, so comparing two states of it cannot be done with set arithmetic — a row that appears three times before and once after has been removed twice. Every row here is paired off against at most one row on the other side, and what stays unpaired is the difference.
Column order is not part of a row's identity: the same columns carrying the same values are the same row however the reader happened to order them.
Type Aliases§
Row = import from TableDefinitionMethods§
public function __construct(private RowMatch $match = new \ZtdQuery\Shadow\Row\RowMatch())Parameters
$match | RowMatch | Decides when two rows are the same row |
Test cases 4
Answers the rows on the left that nothing on the right pairs with.
Parameters
Returns
list<Row> The unpaired rows, in the order the left held themTest cases 4
RowMultisetTest::testDifferenceAnswersTheRowsNothingOnTheOtherSidePairsWithcovers and callsRowMultisetTest::testDifferenceIgnoresTheOrderTheColumnsWereReadIncovers and callsRowMultisetTest::testDifferenceIsNothingWhereEveryRowIsPairedOffcovers and callsRowMultisetTest::testDifferencePairsOffARepeatedRowOnlyOncecovers and calls
Called from 5
- method-call ZtdQuery\Shadow\Mutation\MutationImpact::affectedRowCount() packages/ztd-query-core/src/Shadow/Mutation/MutationImpact.php:71
- method-call ZtdQuery\Shadow\Mutation\MutationImpact::affectedRowCount() packages/ztd-query-core/src/Shadow/Mutation/MutationImpact.php:72
- method-call ZtdQuery\Shadow\Mutation\MutationImpact::returningRows() packages/ztd-query-core/src/Shadow/Mutation/MutationImpact.php:88
- method-call ZtdQuery\Shadow\Mutation\Table\SynchronizeMutation::affectedRowCount() packages/ztd-query-core/src/Shadow/Mutation/Table/SynchronizeMutation.php:94
- method-call ZtdQuery\Shadow\Mutation\Table\SynchronizeMutation::affectedRowCount() packages/ztd-query-core/src/Shadow/Mutation/Table/SynchronizeMutation.php:95
Calls 1
- method-call RowMatch::sameRow() line 46
Private surface 1§
Implementation details, listed for orientation only.
private RowMatch $match = 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
RowMultisetTest::testDifferenceAnswersTheRowsNothingOnTheOtherSidePairsWithcovers and callsRowMultisetTest::testDifferenceIgnoresTheOrderTheColumnsWereReadIncovers and callsRowMultisetTest::testDifferenceIsNothingWhereEveryRowIsPairedOffcovers and callsRowMultisetTest::testDifferencePairsOffARepeatedRowOnlyOncecovers and calls
Other tests reaching this symbol 6
SessionTestcallsMutationImpactTestcallsSynchronizeMutationTestcallsReferentialIntegrityEnforcerTestcallsShadowApplicationTestcallsStatementSimulatorTestcalls
Relations§
Instantiated in 2
Method calls 5
- method-call ZtdQuery\Shadow\Mutation\MutationImpact::affectedRowCount() packages/ztd-query-core/src/Shadow/Mutation/MutationImpact.php:71
- method-call ZtdQuery\Shadow\Mutation\MutationImpact::affectedRowCount() packages/ztd-query-core/src/Shadow/Mutation/MutationImpact.php:72
- method-call ZtdQuery\Shadow\Mutation\MutationImpact::returningRows() packages/ztd-query-core/src/Shadow/Mutation/MutationImpact.php:88
- method-call ZtdQuery\Shadow\Mutation\Table\SynchronizeMutation::affectedRowCount() packages/ztd-query-core/src/Shadow/Mutation/Table/SynchronizeMutation.php:94
- method-call ZtdQuery\Shadow\Mutation\Table\SynchronizeMutation::affectedRowCount() packages/ztd-query-core/src/Shadow/Mutation/Table/SynchronizeMutation.php:95