classMultiTableMutationRow
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 TableDefinitionMethods§
public function valueColumn(int $targetIndex, int $columnIndex): stringAnswers the name one table's value is carried under.
Parameters
$targetIndex | int | Position of the table in the statement |
$columnIndex | int | Position of the column among that table's values |
Returns
string Name no table would useTest cases 4
MultiTableMutationRowTest::testIdentityColumnValueColumnIdentityColumnExtractsValuesAndIdentityByTargetOrdinalcovers and callsMultiTableMutationRowTest::testValueColumnNamesEachTableAndColumnApartcovers and callsMultiTableMutationRowTest::testValueColumnNamesOneTableValueSoNoTableCouldUseTheNamecovers and callsMultiTableMutationRowTest::testValuesRejectsIncompleteProjectedRowscovers
Called from 1
Calls 1
- class-const MultiTableMutationRow::PREFIX() line 34
public function identityColumn(int $targetIndex, int $primaryKeyIndex): stringAnswers the name one table's old key value is carried under.
Parameters
$targetIndex | int | Position of the table in the statement |
$primaryKeyIndex | int | Position of the column among that table's key columns |
Returns
string Name no table would useTest cases 2
Called from 1
Calls 1
- class-const MultiTableMutationRow::PREFIX() line 47
Reads one table's values off a result row, under the names it declares.
Parameters
$row | Row | Row as the rewritten statement read it back |
$targetIndex | int | Position of the table in the statement |
$columns | list<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 tableTest cases 2
Called from 2
Calls 2
- method-call MultiTableMutationRow::valueColumn() line 63
- function-call
array_key_existsline 64
Reads one table's old key off a result row, under the names it declares.
Parameters
$row | Row | Row as the rewritten statement read it back |
$targetIndex | int | Position of the table in the statement |
$primaryKeys | list<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 tableTest cases 2
Called from 1
Calls 2
- method-call MultiTableMutationRow::identityColumn() line 86
- function-call
array_key_existsline 87
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
MultiTableMutationRowTest::testIdentityColumnValueColumnIdentityColumnExtractsValuesAndIdentityByTargetOrdinalcovers and callsMultiTableMutationRowTest::testValueColumnNamesEachTableAndColumnApartcovers and callsMultiTableMutationRowTest::testValueColumnNamesOneTableValueSoNoTableCouldUseTheNamecovers and callsMultiTableMutationRowTest::testValuesRejectsIncompleteProjectedRowscovers and calls
Other tests reaching this symbol 2
MultiDeleteMutationTestcallsMultiUpdateMutationTestcalls
Relations§
Instantiated in 2
Method calls 3
- method-call ZtdQuery\Shadow\Mutation\Row\MultiDeleteMutation::apply() packages/ztd-query-core/src/Shadow/Mutation/Row/MultiDeleteMutation.php:45
- method-call ZtdQuery\Shadow\Mutation\Row\MultiUpdateMutation::apply() packages/ztd-query-core/src/Shadow/Mutation/Row/MultiUpdateMutation.php:44
- method-call ZtdQuery\Shadow\Mutation\Row\MultiUpdateMutation::apply() packages/ztd-query-core/src/Shadow/Mutation/Row/MultiUpdateMutation.php:45
Constant reads 1
- class-const packages/ztd-query-core/src/Compatibility/ClassAliases.php packages/ztd-query-core/src/Compatibility/ClassAliases.php:17