ConditionAggregateInterface.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 \Drupal\Core\Entity\Query\ConditionAggregateInterface
  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. * @return ConditionInterface
  34. * @see \Drupal\Core\Entity\Query\QueryInterface::exists()
  35. */
  36. public function exists($field, $function, $langcode = NULL);
  37. /**
  38. * Queries for the nonexistence of a field.
  39. *
  40. * @param string $field
  41. * @return ConditionInterface
  42. * @see \Drupal\Core\Entity\Query\QueryInterface::notExists()
  43. */
  44. public function notExists($field, $function, $langcode = NULL);
  45. /**
  46. * Gets a complete list of all conditions in this conditional clause.
  47. *
  48. * This method returns by reference. That allows alter hooks to access the
  49. * data structure directly and manipulate it before it gets compiled.
  50. *
  51. * @return array
  52. */
  53. public function &conditions();
  54. /**
  55. * Compiles this conditional clause.
  56. *
  57. * @param $query
  58. * The query object this conditional clause belongs to.
  59. */
  60. public function compile($query);
  61. }