classCreateTableLikeMutation
final class CreateTableLikeMutation
implements ShadowMutation
Applies CREATE TABLE ... LIKE ... operation to the virtual schema. This mutation copies the TableDefinition from an existing table to a new table.
Methods§
public function __construct(
string $tableName,
string $sourceTableName,
TableDefinitionRegistry $registry,
bool $ifNotExists = false,
)Binds the instance to what it will work from.
Parameters
$tableName | string | |
$sourceTableName | string | |
$registry | TableDefinitionRegistry | |
$ifNotExists | bool |
Test cases 6
CreateTableLikeMutationTest::testApplyCopiesSchemaFromSourceTablecoversCreateTableLikeMutationTest::testApplyEnsuresNewTableInShadowStorecoversCreateTableLikeMutationTest::testApplyThrowsExceptionWhenSourceTableDoesNotExistcoversCreateTableLikeMutationTest::testApplyThrowsExceptionWhenTargetTableExistscoversCreateTableLikeMutationTest::testApplyWithIfNotExistsSkipsWhenTableExistscoversCreateTableLikeMutationTest::testTableNameReturnsNewTableNamecovers
public function apply(ShadowStore $store, array $rows): void{@inheritDoc}
Parameters
$store | ShadowStore | |
$rows | array |
Throws
RuntimeException When the table being copied from is not one anything has describedTest cases 5
CreateTableLikeMutationTest::testApplyCopiesSchemaFromSourceTablecovers and callsCreateTableLikeMutationTest::testApplyEnsuresNewTableInShadowStorecovers and callsCreateTableLikeMutationTest::testApplyThrowsExceptionWhenSourceTableDoesNotExistcovers and callsCreateTableLikeMutationTest::testApplyThrowsExceptionWhenTargetTableExistscovers and callsCreateTableLikeMutationTest::testApplyWithIfNotExistsSkipsWhenTableExistscovers and calls
Calls 5
- method-call TableDefinitionRegistry::has() line 51
- new
RuntimeExceptionline 55 - method-call TableDefinitionRegistry::get() line 58
- method-call TableDefinitionRegistry::register() line 63
- method-call ShadowStore::ensure() line 64
public function tableName(): string{@inheritDoc}
Returns
stringTest cases 1
CreateTableLikeMutationTest::testTableNameReturnsNewTableNamecovers and calls
Private surface 4§
Implementation details, listed for orientation only.
private string $tableNameprivate string $sourceTableNameprivate TableDefinitionRegistry $registryprivate bool $ifNotExistsTest cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
CreateTableLikeMutationTest::testApplyCopiesSchemaFromSourceTablecovers and callsCreateTableLikeMutationTest::testApplyEnsuresNewTableInShadowStorecovers and callsCreateTableLikeMutationTest::testApplyThrowsExceptionWhenSourceTableDoesNotExistcovers and callsCreateTableLikeMutationTest::testApplyThrowsExceptionWhenTargetTableExistscovers and callsCreateTableLikeMutationTest::testApplyWithIfNotExistsSkipsWhenTableExistscovers and callsCreateTableLikeMutationTest::testTableNameReturnsNewTableNamecovers and calls
Relations§
Constant reads 1
- class-const packages/ztd-query-core/src/Compatibility/ClassAliases.php packages/ztd-query-core/src/Compatibility/ClassAliases.php:26