function Truncate::__toString

Same name in this branch
  1. 11.x core/lib/Drupal/Core/Database/Query/Truncate.php \Drupal\Core\Database\Query\Truncate::__toString()
Same name in other branches
  1. 9 core/modules/sqlite/src/Driver/Database/sqlite/Truncate.php \Drupal\sqlite\Driver\Database\sqlite\Truncate::__toString()
  2. 9 core/lib/Drupal/Core/Database/Query/Truncate.php \Drupal\Core\Database\Query\Truncate::__toString()
  3. 8.9.x core/lib/Drupal/Core/Database/Driver/sqlite/Truncate.php \Drupal\Core\Database\Driver\sqlite\Truncate::__toString()
  4. 8.9.x core/lib/Drupal/Core/Database/Query/Truncate.php \Drupal\Core\Database\Query\Truncate::__toString()
  5. 10 core/modules/sqlite/src/Driver/Database/sqlite/Truncate.php \Drupal\sqlite\Driver\Database\sqlite\Truncate::__toString()
  6. 10 core/lib/Drupal/Core/Database/Query/Truncate.php \Drupal\Core\Database\Query\Truncate::__toString()

Overrides Truncate::__toString

File

core/modules/sqlite/src/Driver/Database/sqlite/Truncate.php, line 15

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.