function 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/modules/sqlite/src/Driver/Database/sqlite/Truncate.php, line 25

Class

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

Namespace

Drupal\sqlite\Driver\Database\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) . '} ';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.