final class MultiTableMutationRow

Names the columns a multi-table statement carries its per-table values under.

One statement writing to several tables reads back as one result set, so each table's values and its old key have to be carried under names no table would use and taken apart again afterwards. The names are built from the position of the table in the statement, which is the only thing both sides agree on.

Type Aliases§

Row = import from TableDefinition

Methods§

public function valueColumn(int $targetIndex, int $columnIndex): string

Answers the name one table's value is carried under.

Parameters

$targetIndexintPosition of the table in the statement
$columnIndexintPosition of the column among that table's values

Returns

string Name no table would use
Test cases 4
Called from 1
Calls 1
public function identityColumn(int $targetIndex, int $primaryKeyIndex): string

Answers the name one table's old key value is carried under.

Parameters

$targetIndexintPosition of the table in the statement
$primaryKeyIndexintPosition of the column among that table's key columns

Returns

string Name no table would use
Test cases 2
Called from 1
Calls 1
public function values(Row $row, int $targetIndex, list<string> $columns): Row|null

Reads one table's values off a result row, under the names it declares.

Parameters

$rowRowRow as the rewritten statement read it back
$targetIndexintPosition of the table in the statement
$columnslist<string>That table's columns, in the order they were written

Returns

Row|null Column => value, or null when the row carries no values for that table
Test cases 2
Called from 2
Calls 2
public function identity(Row $row, int $targetIndex, list<string> $primaryKeys): Row|null

Reads one table's old key off a result row, under the names it declares.

Parameters

$rowRowRow as the rewritten statement read it back
$targetIndexintPosition of the table in the statement
$primaryKeyslist<string>That table's key columns, in the order they were written

Returns

Row|null Key column => value, or null when the row carries no key for that table
Test cases 2
Called from 1
Calls 2

Private surface 1§

Implementation details, listed for orientation only.

private const PREFIX = '__ztd_multi_'

Test cases 6§

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

Dedicated tests 4
Other tests reaching this symbol 2

Relations§

Instantiated in 2
Method calls 3
Constant reads 1