d42e48feb75b1bf97369bc7363f34125997c033e
[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 minus one, because one element is the
23    * conjunction.
24    */
25   public function count();
26
27   /**
28    * Adds a condition.
29    *
30    * @param string|\Drupal\Core\Entity\Query\ConditionInterface $field
31    * @param mixed $value
32    * @param string $operator
33    * @param string $langcode
34    * @return ConditionInterface
35    * @see \Drupal\Core\Entity\Query\QueryInterface::condition()
36    */
37   public function condition($field, $value = NULL, $operator = NULL, $langcode = NULL);
38
39   /**
40    * Queries for the existence of a field.
41    *
42    * @param $field
43    * @param string $langcode
44    * @return ConditionInterface
45    * @see \Drupal\Core\Entity\Query\QueryInterface::exists()
46    */
47   public function exists($field, $langcode = NULL);
48
49   /**
50    * Queries for the existence of a field.
51    *
52    * @param string $field
53    * @return ConditionInterface
54    * @see \Drupal\Core\Entity\Query\QueryInterface::notexists()
55    */
56   public function notExists($field, $langcode = NULL);
57
58   /**
59    * Gets a complete list of all conditions in this conditional clause.
60    *
61    * This method returns by reference. That allows alter hooks to access the
62    * data structure directly and manipulate it before it gets compiled.
63    *
64    * @return array
65    */
66   public function &conditions();
67
68   /**
69    * Compiles this conditional clause.
70    *
71    * @param $query
72    *   The query object this conditional clause belongs to.
73    */
74   public function compile($query);
75
76 }