public function Truncate::__toString

public Truncate::__toString()

Implements PHP magic __toString method to convert the query to a string.

Return value

string The prepared statement.

Overrides Truncate::__toString

File

core/lib/Drupal/Core/Database/Driver/sqlite/Truncate.php, line 14

Class

Truncate
SQLite implementation of \Drupal\Core\Database\Query\Truncate.

Namespace

Drupal\Core\Database\Driver\sqlite

Code

public function __toString() {
  // Create a sanitized comment string to prepend to the query.
  $comments = $this->connection->makeComment($this->comments);

  return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '} ';
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!Driver!sqlite!Truncate.php/function/Truncate::__toString/8.1.x