class ConditionBase

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/Query/ConditionBase.php \Drupal\Core\Entity\Query\ConditionBase
  2. 10 core/lib/Drupal/Core/Entity/Query/ConditionBase.php \Drupal\Core\Entity\Query\ConditionBase
  3. 11.x core/lib/Drupal/Core/Entity/Query/ConditionBase.php \Drupal\Core\Entity\Query\ConditionBase

Defines a common base class for all entity condition implementations.

Hierarchy

Expanded class hierarchy of ConditionBase

3 files declare their use of ConditionBase
Condition.php in core/lib/Drupal/Core/Config/Entity/Query/Condition.php
Condition.php in core/lib/Drupal/Core/Entity/Query/Sql/Condition.php
Condition.php in core/lib/Drupal/Core/Entity/Query/Null/Condition.php

File

core/lib/Drupal/Core/Entity/Query/ConditionBase.php, line 8

Namespace

Drupal\Core\Entity\Query
View source
abstract class ConditionBase extends ConditionFundamentals implements ConditionInterface {
    
    /**
     * {@inheritdoc}
     */
    public function condition($field, $value = NULL, $operator = NULL, $langcode = NULL) {
        $this->conditions[] = [
            'field' => $field,
            'value' => $value,
            'operator' => $operator,
            'langcode' => $langcode,
        ];
        return $this;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
ConditionBase::condition public function Adds a condition. Overrides ConditionInterface::condition
ConditionFundamentals::$conditions protected property Array of conditions.
ConditionFundamentals::$conjunction protected property The conjunction of this condition group.
ConditionFundamentals::$namespaces protected property List of potential namespaces of the classes belonging to this condition.
ConditionFundamentals::$query protected property The query this condition belongs to. 1
ConditionFundamentals::conditions public function
ConditionFundamentals::count public function
ConditionFundamentals::getConjunction public function
ConditionFundamentals::__clone public function Implements the magic __clone function.
ConditionFundamentals::__construct public function Constructs a Condition object.
ConditionInterface::compile public function Compiles this conditional clause. 3
ConditionInterface::exists public function Queries for the existence of a field. 3
ConditionInterface::notExists public function Queries for the nonexistence of a field. 3

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.