web-base/core/Driver/SQL/Query/Truncate.class.php

21 lines
454 B
PHP
Raw Normal View History

2020-04-02 00:02:51 +02:00
<?php
namespace Driver\SQL\Query;
2021-04-02 21:58:06 +02:00
use Driver\SQL\SQL;
2020-04-02 00:02:51 +02:00
class Truncate extends Query {
2020-04-03 17:39:58 +02:00
private string $tableName;
2020-04-02 00:02:51 +02:00
2021-04-02 21:58:06 +02:00
public function __construct(SQL $sql, string $name) {
2020-04-02 00:02:51 +02:00
parent::__construct($sql);
$this->tableName = $name;
}
2021-04-02 21:58:06 +02:00
public function getTable(): string { return $this->tableName; }
2021-04-08 18:29:47 +02:00
public function build(array &$params, Query $context = NULL): ?string {
return "TRUNCATE " . $this->sql->tableName($this->getTable());
}
2020-04-03 17:39:58 +02:00
}