class Condition in Drupal 10
Same name in this branch
- 10 core/lib/Drupal/Core/Condition/Annotation/Condition.php \Drupal\Core\Condition\Annotation\Condition
- 10 core/lib/Drupal/Core/Database/Query/Condition.php \Drupal\Core\Database\Query\Condition
- 10 core/lib/Drupal/Core/Config/Entity/Query/Condition.php \Drupal\Core\Config\Entity\Query\Condition
- 10 core/lib/Drupal/Core/Entity/KeyValueStore/Query/Condition.php \Drupal\Core\Entity\KeyValueStore\Query\Condition
- 10 core/lib/Drupal/Core/Entity/Query/Sql/Condition.php \Drupal\Core\Entity\Query\Sql\Condition
- 10 core/lib/Drupal/Core/Entity/Query/Null/Condition.php \Drupal\Core\Entity\Query\Null\Condition
- 10 core/lib/Drupal/Core/Entity/Query/Sql/pgsql/Condition.php \Drupal\Core\Entity\Query\Sql\pgsql\Condition
- 10 core/tests/fixtures/database_drivers/module/corefake/src/Driver/Database/corefakeWithAllCustomClasses/Condition.php \Drupal\corefake\Driver\Database\corefakeWithAllCustomClasses\Condition
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/Query/Sql/pgsql/Condition.php \Drupal\Core\Entity\Query\Sql\pgsql\Condition
- 9 core/lib/Drupal/Core/Entity/Query/Sql/pgsql/Condition.php \Drupal\Core\Entity\Query\Sql\pgsql\Condition
Implements entity query conditions for PostgreSQL databases.
Hierarchy
- class \Drupal\Core\Entity\Query\ConditionFundamentals
- class \Drupal\Core\Entity\Query\ConditionBase implements ConditionInterface
Expanded class hierarchy of Condition
4 string references to 'Condition'
- ConditionAggregate::compile in core/
lib/ Drupal/ Core/ Entity/ Query/ Sql/ ConditionAggregate.php - ConnectionTest::providerGetDriverClass in core/
tests/ Drupal/ Tests/ Core/ Database/ ConnectionTest.php - Data provider for testGetDriverClass().
- core.data_types.schema.yml in core/
config/ schema/ core.data_types.schema.yml - core/config/schema/core.data_types.schema.yml
- QueryBase::conditionGroupFactory in core/
lib/ Drupal/ Core/ Entity/ Query/ QueryBase.php - Creates an object holding a group of conditions.
File
- core/
lib/ Drupal/ Core/ Entity/ Query/ Sql/ pgsql/ Condition.php, line 11
Namespace
Drupal\Core\Entity\Query\Sql\pgsqlView source
class Condition extends BaseCondition {
/**
* {@inheritdoc}
*/
public static function translateCondition(&$condition, SelectInterface $sql_query, $case_sensitive) {
if (is_array($condition['value']) && $case_sensitive === FALSE) {
$condition['where'] = 'LOWER(' . $sql_query
->escapeField($condition['real_field']) . ') ' . $condition['operator'] . ' (';
$condition['where_args'] = [];
// Only use the array values in case an associative array is passed as an
// argument following similar pattern in
// \Drupal\Core\Database\Connection::expandArguments().
$where_prefix = str_replace('.', '_', $condition['real_field']);
foreach ($condition['value'] as $key => $value) {
$where_id = $where_prefix . $key;
$condition['where'] .= 'LOWER(:' . $where_id . '),';
$condition['where_args'][':' . $where_id] = $value;
}
$condition['where'] = trim($condition['where'], ',');
$condition['where'] .= ')';
}
parent::translateCondition($condition, $sql_query, $case_sensitive);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Condition:: |
protected | property | Whether this condition is nested inside an OR condition. | |
Condition:: |
protected | property |
The SQL entity query object this condition belongs to. Overrides ConditionFundamentals:: |
|
Condition:: |
public | function |
Compiles this conditional clause. Overrides ConditionInterface:: |
|
Condition:: |
public | function |
Queries for the existence of a field. Overrides ConditionInterface:: |
|
Condition:: |
public | function |
Queries for the nonexistence of a field. Overrides ConditionInterface:: |
|
Condition:: |
public static | function |
Translates the string operators to SQL equivalents. Overrides Condition:: |
|
ConditionBase:: |
public | function |
Adds a condition. Overrides ConditionInterface:: |
|
ConditionFundamentals:: |
protected | property | Array of conditions. | |
ConditionFundamentals:: |
protected | property | The conjunction of this condition group. | |
ConditionFundamentals:: |
protected | property | List of potential namespaces of the classes belonging to this condition. | |
ConditionFundamentals:: |
public | function | ||
ConditionFundamentals:: |
public | function | ||
ConditionFundamentals:: |
public | function | ||
ConditionFundamentals:: |
public | function | Implements the magic __clone function. | |
ConditionFundamentals:: |
public | function | Constructs a Condition object. |