public function Delete::execute

Same name in this branch
  1. 8.x drupal/core/lib/Drupal/Core/Database/Query/Delete.php \Drupal\Core\Database\Query\Delete::execute()
  2. 8.x drupal/core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php \Drupal\Core\Database\Driver\sqlite\Delete::execute()

Executes the DELETE query.

Return value

The return value is dependent on the database connection.

Overrides Delete::execute

File

drupal/core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php, line 23
Definition of Drupal\Core\Database\Driver\sqlite\Delete

Class

Delete
SQLite specific implementation of DeleteQuery.

Namespace

Drupal\Core\Database\Driver\sqlite

Code

public function execute() {
  if (!count($this->condition)) {
    $total_rows = $this->connection
      ->query('SELECT COUNT(*) FROM {' . $this->connection
      ->escapeTable($this->table) . '}')
      ->fetchField();
    parent::execute();
    return $total_rows;
  }
  else {
    return parent::execute();
  }
}