classDropTableMutation
final class DropTableMutation
implements ShadowMutation
Applies DROP TABLE operation to the virtual schema. This mutation marks a table as removed from the virtual schema and clears its rows.
Methods§
public function __construct(
string $tableName,
TableDefinitionRegistry $registry,
string $sourceSql,
bool $ifExists = false,
)Binds the instance to what it will work from.
Parameters
$tableName | string | |
$registry | TableDefinitionRegistry | |
$sourceSql | string | |
$ifExists | bool |
Test cases 6
DropTableMutationTest::testApplyClearsDataFromShadowStorecoversDropTableMutationTest::testApplyThrowsExceptionWhenTableDoesNotExistcoversDropTableMutationTest::testApplyUnregistersTableFromSchemacoversDropTableMutationTest::testApplyWithIfExistsDropsExistingTablecoversDropTableMutationTest::testApplyWithIfExistsSkipsWhenTableDoesNotExistcoversDropTableMutationTest::testTableNameReturnsTableNamecovers
public function apply(ShadowStore $store, array $rows): void{@inheritDoc}
Parameters
$store | ShadowStore | |
$rows | array |
Throws
SchemaNotFoundException When the table is not there and the statement did not allow for thatTest cases 5
DropTableMutationTest::testApplyClearsDataFromShadowStorecovers and callsDropTableMutationTest::testApplyThrowsExceptionWhenTableDoesNotExistcovers and callsDropTableMutationTest::testApplyUnregistersTableFromSchemacovers and callsDropTableMutationTest::testApplyWithIfExistsDropsExistingTablecovers and callsDropTableMutationTest::testApplyWithIfExistsSkipsWhenTableDoesNotExistcovers and calls
Calls 4
- method-call TableDefinitionRegistry::has() line 50
- new SchemaNotFoundException line 54
- method-call TableDefinitionRegistry::markRemoved() line 57
- method-call ShadowStore::remove() line 58
public function tableName(): string{@inheritDoc}
Returns
stringTest cases 1
DropTableMutationTest::testTableNameReturnsTableNamecovers and calls
Private surface 4§
Implementation details, listed for orientation only.
private string $tableNameprivate TableDefinitionRegistry $registryprivate string $sourceSqlprivate bool $ifExistsTest cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
DropTableMutationTest::testApplyClearsDataFromShadowStorecovers and callsDropTableMutationTest::testApplyThrowsExceptionWhenTableDoesNotExistcovers and callsDropTableMutationTest::testApplyUnregistersTableFromSchemacovers and callsDropTableMutationTest::testApplyWithIfExistsDropsExistingTablecovers and callsDropTableMutationTest::testApplyWithIfExistsSkipsWhenTableDoesNotExistcovers and callsDropTableMutationTest::testTableNameReturnsTableNamecovers and calls
Other tests reaching this symbol 2
Relations§
Constant reads 1
- class-const packages/ztd-query-core/src/Compatibility/ClassAliases.php packages/ztd-query-core/src/Compatibility/ClassAliases.php:32