function 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 1402

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.