public function Delete::execute in Drupal 9
Same name in this branch
- 9 core/lib/Drupal/Core/Database/Query/Delete.php \Drupal\Core\Database\Query\Delete::execute()
- 9 core/lib/Drupal/Core/Database/Driver/pgsql/Delete.php \Drupal\Core\Database\Driver\pgsql\Delete::execute()
Same name and namespace in other branches
- 8 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
1 call to Delete::execute()
- Delete::execute in core/
lib/ Drupal/ Core/ Database/ Driver/ pgsql/ Delete.php - Executes the DELETE query.
1 method overrides Delete::execute()
- Delete::execute in core/
lib/ Drupal/ Core/ Database/ Driver/ pgsql/ Delete.php - Executes the DELETE query.
File
- core/
lib/ Drupal/ Core/ Database/ Query/ Delete.php, line 48
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);
}
}