You are here

public function SelectExtender::where in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Database/Query/SelectExtender.php \Drupal\Core\Database\Query\SelectExtender::where()

Adds an arbitrary WHERE clause to the query.

Parameters

string $snippet: A portion of a WHERE clause as a prepared statement. It must use named placeholders, not ? placeholders. The caller is responsible for providing unique placeholders that do not interfere with the placeholders generated by this QueryConditionInterface object.

array $args: An associative array of arguments keyed by the named placeholders.

Return value

$this The called object.

Overrides ConditionInterface::where

File

core/lib/Drupal/Core/Database/Query/SelectExtender.php, line 129

Class

SelectExtender
The base extender class for Select queries.

Namespace

Drupal\Core\Database\Query

Code

public function where($snippet, $args = []) {
  $this->query
    ->where($snippet, $args);
  return $this;
}