You are here

public function Select::forUpdate in Drupal 9

Same name in this branch
  1. 9 core/lib/Drupal/Core/Database/Query/Select.php \Drupal\Core\Database\Query\Select::forUpdate()
  2. 9 core/lib/Drupal/Core/Database/Driver/sqlite/Select.php \Drupal\Core\Database\Driver\sqlite\Select::forUpdate()
Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Database/Driver/sqlite/Select.php \Drupal\Core\Database\Driver\sqlite\Select::forUpdate()

Add FOR UPDATE to the query.

FOR UPDATE prevents the rows retrieved by the SELECT statement from being modified or deleted by other transactions until the current transaction ends. Other transactions that attempt UPDATE, DELETE, or SELECT FOR UPDATE of these rows will be blocked until the current transaction ends.

Parameters

$set: IF TRUE, FOR UPDATE will be added to the query, if FALSE then it won't.

Return value

\Drupal\Core\Database\Query\ConditionInterface The called object.

Overrides Select::forUpdate

File

core/lib/Drupal/Core/Database/Driver/sqlite/Select.php, line 12

Class

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

Namespace

Drupal\Core\Database\Driver\sqlite

Code

public function forUpdate($set = TRUE) {

  // SQLite does not support FOR UPDATE so nothing to do.
  return $this;
}