You are here

interface ConditionGroupInterface in Search API 8

Represents a condition group on a search query.

Condition groups can contain both basic (field operator value) conditions and nested condition groups.

Hierarchy

Expanded class hierarchy of ConditionGroupInterface

All classes that implement ConditionGroupInterface

4 files declare their use of ConditionGroupInterface
AllTermsArgumentTest.php in tests/src/Unit/Views/AllTermsArgumentTest.php
Database.php in modules/search_api_db/src/Plugin/search_api/backend/Database.php
FieldsProcessorPluginBase.php in src/Processor/FieldsProcessorPluginBase.php
SearchApiQuery.php in src/Plugin/views/query/SearchApiQuery.php

File

src/Query/ConditionGroupInterface.php, line 11

Namespace

Drupal\search_api\Query
View source
interface ConditionGroupInterface extends ConditionSetInterface {

  /**
   * Retrieves the conjunction used by this condition group.
   *
   * @return string
   *   The conjunction used by this condition group – either 'AND' or 'OR'.
   */
  public function getConjunction();

  /**
   * Retrieves all conditions and nested condition groups of this object.
   *
   * @return \Drupal\search_api\Query\ConditionInterface[]|\Drupal\search_api\Query\ConditionGroupInterface[]
   *   An array containing this object's conditions. Each of these is either a
   *   simple condition, represented as an object of type
   *   \Drupal\search_api\Query\ConditionInterface, or a nested condition group,
   *   represented by a \Drupal\search_api\Query\ConditionGroupInterface object.
   *   Returned by reference so it's possible, for example, to remove
   *   conditions.
   */
  public function &getConditions();

  /**
   * Checks whether a certain tag was set on this condition group.
   *
   * @param string $tag
   *   A tag to check for.
   *
   * @return bool
   *   TRUE if the tag was set for this condition group, FALSE otherwise.
   */
  public function hasTag($tag);

  /**
   * Retrieves the tags set on this condition group.
   *
   * @return string[]
   *   The tags associated with this condition group, as both the array keys and
   *   values. Returned by reference so it's possible, for example, to remove
   *   existing tags.
   */
  public function &getTags();

}

Members

Namesort descending Modifiers Type Description Overrides
ConditionGroupInterface::getConditions public function Retrieves all conditions and nested condition groups of this object. 1
ConditionGroupInterface::getConjunction public function Retrieves the conjunction used by this condition group. 1
ConditionGroupInterface::getTags public function Retrieves the tags set on this condition group. 1
ConditionGroupInterface::hasTag public function Checks whether a certain tag was set on this condition group. 1
ConditionSetInterface::addCondition public function Adds a new ($field $operator $value) condition. 2
ConditionSetInterface::addConditionGroup public function Adds a nested condition group. 2