web-base/core/Driver/SQL/Query/Truncate.class.php
2021-04-08 18:29:47 +02:00

21 lines
454 B
PHP

<?php
namespace Driver\SQL\Query;
use Driver\SQL\SQL;
class Truncate extends Query {
private string $tableName;
public function __construct(SQL $sql, string $name) {
parent::__construct($sql);
$this->tableName = $name;
}
public function getTable(): string { return $this->tableName; }
public function build(array &$params, Query $context = NULL): ?string {
return "TRUNCATE " . $this->sql->tableName($this->getTable());
}
}