function ConditionBase::condition
Adds a condition.
Parameters
string|\Drupal\Core\Entity\Query\ConditionInterface $field: The field.
mixed $value: (optional) The value.
string $operator: (optional) The operator.
string $langcode: (optional) For which language the entity should be prepared, defaults to the current content language.
Return value
$this
Overrides ConditionInterface::condition
6 calls to ConditionBase::condition()
- Condition::exists in core/
lib/ Drupal/ Core/ Config/ Entity/ Query/ Condition.php  - Queries for the existence of a field.
 - Condition::exists in core/
lib/ Drupal/ Core/ Entity/ Query/ Sql/ Condition.php  - Queries for the existence of a field.
 - Condition::exists in core/
lib/ Drupal/ Core/ Entity/ Query/ Null/ Condition.php  - Queries for the existence of a field.
 - Condition::notExists in core/
lib/ Drupal/ Core/ Config/ Entity/ Query/ Condition.php  - Queries for the nonexistence of a field.
 - Condition::notExists in core/
lib/ Drupal/ Core/ Entity/ Query/ Sql/ Condition.php  - Queries for the nonexistence of a field.
 
File
- 
              core/
lib/ Drupal/ Core/ Entity/ Query/ ConditionBase.php, line 13  
Class
- ConditionBase
 - Defines a common base class for all entity condition implementations.
 
Namespace
Drupal\Core\Entity\QueryCode
public function condition($field, $value = NULL, $operator = NULL, $langcode = NULL) {
  $this->conditions[] = [
    'field' => $field,
    'value' => $value,
    'operator' => $operator,
    'langcode' => $langcode,
  ];
  return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.