function Delete::execute
Same name and namespace in other branches
- 8.9.x core/lib/Drupal/Core/Database/Driver/pgsql/Delete.php \Drupal\Core\Database\Driver\pgsql\Delete::execute()
- 8.9.x core/lib/Drupal/Core/Database/Query/Delete.php \Drupal\Core\Database\Query\Delete::execute()
- 10 core/lib/Drupal/Core/Database/Query/Delete.php \Drupal\Core\Database\Query\Delete::execute()
- 11.x core/lib/Drupal/Core/Database/Query/Delete.php \Drupal\Core\Database\Query\Delete::execute()
Executes the DELETE query.
Return value
int The number of rows affected by the delete query.
Overrides Query::execute
File
-
core/
lib/ Drupal/ Core/ Database/ Query/ Delete.php, line 50
Class
- Delete
- General class for an abstracted DELETE operation.
Namespace
Drupal\Core\Database\QueryCode
public function execute() {
$values = [];
if (count($this->condition)) {
$this->condition
->compile($this->connection, $this);
$values = $this->condition
->arguments();
}
$stmt = $this->connection
->prepareStatement((string) $this, $this->queryOptions, TRUE);
try {
$stmt->execute($values, $this->queryOptions);
return $stmt->rowCount();
} catch (\Exception $e) {
$this->connection
->exceptionHandler()
->handleExecutionException($e, $stmt, $values, $this->queryOptions);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.