web-base/Core/Driver/SQL/Query/Drop.php

29 lines
518 B
PHP
Raw Permalink Normal View History

2021-01-07 14:59:36 +01:00
<?php
2022-11-18 18:06:46 +01:00
namespace Core\Driver\SQL\Query;
2021-01-07 14:59:36 +01:00
2022-11-18 18:06:46 +01:00
use Core\Driver\SQL\SQL;
2021-01-07 14:59:36 +01:00
class Drop extends Query {
private string $table;
/**
* Drop constructor.
* @param SQL $sql
* @param string $table
*/
2021-04-02 21:58:06 +02:00
public function __construct(SQL $sql, string $table) {
2021-01-07 14:59:36 +01:00
parent::__construct($sql);
$this->table = $table;
}
2021-04-02 21:58:06 +02:00
public function getTable(): string {
2021-01-07 14:59:36 +01:00
return $this->table;
}
2021-04-08 18:29:47 +02:00
2021-04-09 16:05:36 +02:00
public function build(array &$params): ?string {
2021-04-08 18:29:47 +02:00
return "DROP TABLE " . $this->sql->tableName($this->getTable());
}
2021-01-07 14:59:36 +01:00
}