Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Database / Query / QueryConditionTrait.php
1 <?php
2
3 namespace Drupal\Core\Database\Query;
4
5 use Drupal\Core\Database\Connection;
6
7 /**
8  * Provides an implementation of ConditionInterface.
9  *
10  * @see \Drupal\Core\Database\Query\ConditionInterface
11  */
12 trait QueryConditionTrait {
13
14   /**
15    * The condition object for this query.
16    *
17    * Condition handling is handled via composition.
18    *
19    * @var \Drupal\Core\Database\Query\Condition
20    */
21   protected $condition;
22
23   /**
24    * {@inheritdoc}
25    */
26   public function condition($field, $value = NULL, $operator = '=') {
27     $this->condition->condition($field, $value, $operator);
28     return $this;
29   }
30
31   /**
32    * {@inheritdoc}
33    */
34   public function isNull($field) {
35     $this->condition->isNull($field);
36     return $this;
37   }
38
39   /**
40    * {@inheritdoc}
41    */
42   public function isNotNull($field) {
43     $this->condition->isNotNull($field);
44     return $this;
45   }
46
47   /**
48    * {@inheritdoc}
49    */
50   public function exists(SelectInterface $select) {
51     $this->condition->exists($select);
52     return $this;
53   }
54
55   /**
56    * {@inheritdoc}
57    */
58   public function notExists(SelectInterface $select) {
59     $this->condition->notExists($select);
60     return $this;
61   }
62
63   /**
64    * {@inheritdoc}
65    */
66   public function &conditions() {
67     return $this->condition->conditions();
68   }
69
70   /**
71    * {@inheritdoc}
72    */
73   public function arguments() {
74     return $this->condition->arguments();
75   }
76
77   /**
78    * {@inheritdoc}
79    */
80   public function where($snippet, $args = []) {
81     $this->condition->where($snippet, $args);
82     return $this;
83   }
84
85   /**
86    * {@inheritdoc}
87    */
88   public function compile(Connection $connection, PlaceholderInterface $queryPlaceholder) {
89     $this->condition->compile($connection, $queryPlaceholder);
90   }
91
92   /**
93    * {@inheritdoc}
94    */
95   public function compiled() {
96     return $this->condition->compiled();
97   }
98
99   /**
100    * {@inheritdoc}
101    */
102   public function conditionGroupFactory($conjunction = 'AND') {
103     return new Condition($conjunction);
104   }
105
106   /**
107    * {@inheritdoc}
108    */
109   public function andConditionGroup() {
110     return $this->conditionGroupFactory('AND');
111   }
112
113   /**
114    * {@inheritdoc}
115    */
116   public function orConditionGroup() {
117     return $this->conditionGroupFactory('OR');
118   }
119
120 }