bf53a92c2c449ae2d6648133f65e758c38d7c17b
[yaffs-website] / web / core / lib / Drupal / Core / Entity / Query / ConditionInterface.php
1 <?php
2
3 namespace Drupal\Core\Entity\Query;
4
5 /**
6  * Defines the entity query condition interface.
7  */
8 interface ConditionInterface {
9
10   /**
11    * Gets the current conjunction.
12    *
13    * @return string
14    *   Can be AND or OR.
15    */
16   public function getConjunction();
17
18   /**
19    * Implements \Countable::count().
20    *
21    * Returns the size of this conditional. The size of the conditional is the
22    * size of its conditional array.
23    */
24   public function count();
25
26   /**
27    * Adds a condition.
28    *
29    * @param string|\Drupal\Core\Entity\Query\ConditionInterface $field
30    * @param mixed $value
31    * @param string $operator
32    * @param string $langcode
33    * @return ConditionInterface
34    * @see \Drupal\Core\Entity\Query\QueryInterface::condition()
35    */
36   public function condition($field, $value = NULL, $operator = NULL, $langcode = NULL);
37
38   /**
39    * Queries for the existence of a field.
40    *
41    * @param $field
42    * @param string $langcode
43    * @return ConditionInterface
44    * @see \Drupal\Core\Entity\Query\QueryInterface::exists()
45    */
46   public function exists($field, $langcode = NULL);
47
48   /**
49    * Queries for the existence of a field.
50    *
51    * @param string $field
52    * @return ConditionInterface
53    * @see \Drupal\Core\Entity\Query\QueryInterface::notExists()
54    */
55   public function notExists($field, $langcode = NULL);
56
57   /**
58    * Gets a complete list of all conditions in this conditional clause.
59    *
60    * This method returns by reference. That allows alter hooks to access the
61    * data structure directly and manipulate it before it gets compiled.
62    *
63    * @return array
64    */
65   public function &conditions();
66
67   /**
68    * Compiles this conditional clause.
69    *
70    * @param $query
71    *   The query object this conditional clause belongs to.
72    */
73   public function compile($query);
74
75 }