public function SelectQueryInterface::forUpdate

7.x select.inc public SelectQueryInterface::forUpdate($set = TRUE)

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

QueryConditionInterface The called object.

2 methods override SelectQueryInterface::forUpdate()
SelectQuery::forUpdate in drupal/includes/database/select.inc
Add FOR UPDATE to the query.
SelectQueryExtender::forUpdate in drupal/includes/database/select.inc
Add FOR UPDATE to the query.

File

drupal/includes/database/select.inc, line 530

Class

SelectQueryInterface
Interface definition for a Select Query object.

Code

public function forUpdate($set = TRUE);