ConditionAggregateInterface.php 1.7 KB

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