final class DeleteTransformer
    implements SqlTransformer

Transforms DELETE statements into SELECT projections with CTE shadowing.

Methods§

public function __construct(MySqlParser $parser, SelectTransformer $selectTransformer)

Configure the dependencies used by this operation.

Parameters

$parserMySqlParser
$selectTransformerSelectTransformer
Calls 1
public function transform(string $sql, array $tables): string

{@inheritDoc}

Parameters

$sqlstring
$tablesarray

Returns

string
Test cases 13
Called from 2
Calls 9
public function buildProjection(
    DeleteStatement $stmt,
    string $originalSql,
    array<int, string> $columns,
    list<MultiTableMutationTarget> $targets = [],
): array{sql: string, table: string, tables: array<string, array{alias: string}>}

Build a result-select SQL and resolve the target table(s).

Parameters

$stmtDeleteStatement
$originalSqlstring
$columnsarray<int, string>
$targetslist<MultiTableMutationTarget>

Returns

array{sql: string, table: string, tables: array<string, array{alias: string}>}

Throws

RuntimeException
Test cases 47
Called from 3
Calls 2

Private surface 3§

Implementation details, listed for orientation only.

private MySqlParser $parser
private SelectTransformer $selectTransformer
private MySqlCteShadowComposer $cteComposer

Test cases 301§

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

Dedicated tests 60
Other tests reaching this symbol 241

Relations§

Instantiated in 1
Method calls 3
Type declarations 5