Condition
class Condition extends ConditionBase (View source)
Implements entity query conditions for SQL databases.
Properties
| protected array | $conditions | Array of conditions. |
from ConditionFundamentals |
| protected string | $conjunction | The conjunction of this condition group. |
from ConditionFundamentals |
| protected Query | $query | The SQL entity query object this condition belongs to. |
|
| protected array | $namespaces | List of potential namespaces of the classes belonging to this condition. |
from ConditionFundamentals |
| protected bool | $nestedInsideOrCondition | Whether this condition is nested inside an OR condition. |
Methods
Constructs a Condition object.
Adds a condition.
Compiles this conditional clause.
Queries for the existence of a field.
Queries for the nonexistence of a field.
Translates the string operators to SQL equivalents.
Details
__construct(string $conjunction, QueryInterface $query, array $namespaces = [])
Constructs a Condition object.
getConjunction()
{@inheritdoc}
count()
{@inheritdoc}
conditions()
{@inheritdoc}
__clone()
Implements the magic __clone function.
Makes sure condition groups are cloned as well.
$this
condition(string|ConditionInterface $field, mixed $value = NULL, string $operator = NULL, string $langcode = NULL)
Adds a condition.
compile($conditionContainer)
Compiles this conditional clause.
$this
exists(string $field, string $langcode = NULL)
Queries for the existence of a field.
$this
notExists(string $field, string $langcode = NULL)
Queries for the nonexistence of a field.
static
translateCondition(array $condition, SelectInterface $sql_query, bool|null $case_sensitive)
Translates the string operators to SQL equivalents.