3 namespace Drupal\Core\Database\Query;
5 use Drupal\Core\Database\Connection;
8 * Provides an implementation of ConditionInterface.
10 * @see \Drupal\Core\Database\Query\ConditionInterface
12 trait QueryConditionTrait {
15 * The condition object for this query.
17 * Condition handling is handled via composition.
19 * @var \Drupal\Core\Database\Query\Condition
26 public function condition($field, $value = NULL, $operator = '=') {
27 $this->condition->condition($field, $value, $operator);
34 public function isNull($field) {
35 $this->condition->isNull($field);
42 public function isNotNull($field) {
43 $this->condition->isNotNull($field);
50 public function exists(SelectInterface $select) {
51 $this->condition->exists($select);
58 public function notExists(SelectInterface $select) {
59 $this->condition->notExists($select);
66 public function &conditions() {
67 return $this->condition->conditions();
73 public function arguments() {
74 return $this->condition->arguments();
80 public function where($snippet, $args = []) {
81 $this->condition->where($snippet, $args);
88 public function compile(Connection $connection, PlaceholderInterface $queryPlaceholder) {
89 $this->condition->compile($connection, $queryPlaceholder);
95 public function compiled() {
96 return $this->condition->compiled();
102 public function conditionGroupFactory($conjunction = 'AND') {
103 return new Condition($conjunction);
109 public function andConditionGroup() {
110 return $this->conditionGroupFactory('AND');
116 public function orConditionGroup() {
117 return $this->conditionGroupFactory('OR');