final class MutationRowIdentity

Carries the key a row had, alongside the key it has.

An UPDATE may change the very columns that identify a row, and once it has, nothing in the result says which row each new one used to be. The rewritten statement therefore selects the old key as well, under a name no table would use, and this is what puts that name on and takes it off again.

Type Aliases§

Row = import from TableDefinition

Methods§

public function strip(Row $row): Row

Takes the carried names back off a row.

Parameters

$rowRowRow as the rewritten statement read it back

Returns

Row The row as the caller should see it
Test cases 2
Called from 1
Calls 3
public function stripAll(array<int, Row> $rows): array<int, Row>

Takes the carried names back off every one of these rows.

Parameters

$rowsarray<int, Row>Rows as the rewritten statement read them back

Returns

array<int, Row> The rows as the caller should see them
Test cases 2
Called from 2
Calls 2
public function extract(Row $row, list<string> $primaryKeys): array{row: Row, identity: Row}

Splits a row into the row itself and the key it used to have.

A key column the statement did not change carries no old value, so its current one is the old one too.

Parameters

$rowRowRow as the rewritten statement read it back
$primaryKeyslist<string>Columns that identify one row

Returns

array{row: Row, identity: Row} The row, and the key it used to have
Test cases 5
Called from 2
Calls 2

Private surface 1§

Implementation details, listed for orientation only.

private const PREFIX = '__ztd_original_'

Test cases 16§

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

Dedicated tests 9
Other tests reaching this symbol 7

Relations§

Instantiated in 3
Method calls 4
Type declarations 2