Truncate.php in Drupal driver for SQL Server and SQL Azure 4.1.x
File
src/Driver/Database/sqlsrv/Truncate.php
View source
<?php
namespace Drupal\sqlsrv\Driver\Database\sqlsrv;
use Drupal\Core\Database\Query\Truncate as QueryTruncate;
class Truncate extends QueryTruncate {
public function execute() {
return $this->connection
->query((string) $this, [], $this->queryOptions);
}
public function __toString() {
$comments = $this->connection
->makeComment($this->comments);
if ($this->connection
->inTransaction()) {
return $comments . 'DELETE FROM {' . $this->connection
->escapeTable($this->table) . '}';
}
else {
return $comments . 'TRUNCATE TABLE {' . $this->connection
->escapeTable($this->table) . '} ';
}
}
}
Classes
Name |
Description |
Truncate |
General class for an abstracted TRUNCATE operation. |