You are here

public function Connection::condition in Drupal 9

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

Prepares and returns a CONDITION query object.

Parameters

string $conjunction: The operator to use to combine conditions: 'AND' or 'OR'.

Return value

\Drupal\Core\Database\Query\Condition A new Condition query object.

See also

\Drupal\Core\Database\Query\Condition

File

core/lib/Drupal/Core/Database/Connection.php, line 1338

Class

Connection
Base Database API class.

Namespace

Drupal\Core\Database

Code

public function condition($conjunction) {
  $class = $this
    ->getDriverClass('Condition');

  // Creating an instance of the class Drupal\Core\Database\Query\Condition
  // should only be created from the database layer. This will allow database
  // drivers to override the default Condition class.
  return new $class($conjunction, FALSE);
}