class Condition

Same name in this branch
  1. 8.9.x core/lib/Drupal/Core/Config/Entity/Query/Condition.php \Drupal\Core\Config\Entity\Query\Condition
  2. 8.9.x core/lib/Drupal/Core/Database/Query/Condition.php \Drupal\Core\Database\Query\Condition
  3. 8.9.x core/lib/Drupal/Core/Entity/Query/Sql/Condition.php \Drupal\Core\Entity\Query\Sql\Condition
  4. 8.9.x core/lib/Drupal/Core/Entity/Query/Null/Condition.php \Drupal\Core\Entity\Query\Null\Condition
  5. 8.9.x core/lib/Drupal/Core/Entity/KeyValueStore/Query/Condition.php \Drupal\Core\Entity\KeyValueStore\Query\Condition
  6. 8.9.x core/lib/Drupal/Core/Condition/Annotation/Condition.php \Drupal\Core\Condition\Annotation\Condition
Same name in other branches
  1. 9 core/tests/fixtures/database_drivers/module/corefake/src/Driver/Database/corefakeWithAllCustomClasses/Condition.php \Drupal\corefake\Driver\Database\corefakeWithAllCustomClasses\Condition
  2. 9 core/lib/Drupal/Core/Config/Entity/Query/Condition.php \Drupal\Core\Config\Entity\Query\Condition
  3. 9 core/lib/Drupal/Core/Database/Query/Condition.php \Drupal\Core\Database\Query\Condition
  4. 9 core/lib/Drupal/Core/Entity/Query/Sql/Condition.php \Drupal\Core\Entity\Query\Sql\Condition
  5. 9 core/lib/Drupal/Core/Entity/Query/Sql/pgsql/Condition.php \Drupal\Core\Entity\Query\Sql\pgsql\Condition
  6. 9 core/lib/Drupal/Core/Entity/Query/Null/Condition.php \Drupal\Core\Entity\Query\Null\Condition
  7. 9 core/lib/Drupal/Core/Entity/KeyValueStore/Query/Condition.php \Drupal\Core\Entity\KeyValueStore\Query\Condition
  8. 9 core/lib/Drupal/Core/Condition/Annotation/Condition.php \Drupal\Core\Condition\Annotation\Condition
  9. 10 core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/Condition.php \Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses\Condition
  10. 10 core/lib/Drupal/Core/Config/Entity/Query/Condition.php \Drupal\Core\Config\Entity\Query\Condition
  11. 10 core/lib/Drupal/Core/Database/Query/Condition.php \Drupal\Core\Database\Query\Condition
  12. 10 core/lib/Drupal/Core/Entity/Query/Sql/Condition.php \Drupal\Core\Entity\Query\Sql\Condition
  13. 10 core/lib/Drupal/Core/Entity/Query/Sql/pgsql/Condition.php \Drupal\Core\Entity\Query\Sql\pgsql\Condition
  14. 10 core/lib/Drupal/Core/Entity/Query/Null/Condition.php \Drupal\Core\Entity\Query\Null\Condition
  15. 10 core/lib/Drupal/Core/Entity/KeyValueStore/Query/Condition.php \Drupal\Core\Entity\KeyValueStore\Query\Condition
  16. 10 core/lib/Drupal/Core/Condition/Attribute/Condition.php \Drupal\Core\Condition\Attribute\Condition
  17. 10 core/lib/Drupal/Core/Condition/Annotation/Condition.php \Drupal\Core\Condition\Annotation\Condition
  18. 11.x core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/Condition.php \Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses\Condition
  19. 11.x core/lib/Drupal/Core/Config/Entity/Query/Condition.php \Drupal\Core\Config\Entity\Query\Condition
  20. 11.x core/lib/Drupal/Core/Database/Query/Condition.php \Drupal\Core\Database\Query\Condition
  21. 11.x core/lib/Drupal/Core/Entity/Query/Sql/Condition.php \Drupal\Core\Entity\Query\Sql\Condition
  22. 11.x core/lib/Drupal/Core/Entity/Query/Sql/pgsql/Condition.php \Drupal\Core\Entity\Query\Sql\pgsql\Condition
  23. 11.x core/lib/Drupal/Core/Entity/Query/Null/Condition.php \Drupal\Core\Entity\Query\Null\Condition
  24. 11.x core/lib/Drupal/Core/Entity/KeyValueStore/Query/Condition.php \Drupal\Core\Entity\KeyValueStore\Query\Condition
  25. 11.x core/lib/Drupal/Core/Condition/Attribute/Condition.php \Drupal\Core\Condition\Attribute\Condition
  26. 11.x core/lib/Drupal/Core/Condition/Annotation/Condition.php \Drupal\Core\Condition\Annotation\Condition

Implements entity query conditions for PostgreSQL databases.

Hierarchy

Expanded class hierarchy of Condition

7 string references to 'Condition'
ConditionAggregate::compile in core/lib/Drupal/Core/Entity/Query/Sql/ConditionAggregate.php
Compiles this conditional clause.
ConditionManager::getType in core/lib/Drupal/Core/Condition/ConditionManager.php
A string identifying the plugin type.
Connection::condition in core/lib/Drupal/Core/Database/Connection.php
Prepares and returns a CONDITION query object.
Connection::getDriverClass in core/lib/Drupal/Core/Database/Connection.php
Gets the driver-specific override class if any for the specified class.
core.data_types.schema.yml in core/config/schema/core.data_types.schema.yml
core/config/schema/core.data_types.schema.yml

... See full list

File

core/lib/Drupal/Core/Entity/Query/Sql/pgsql/Condition.php, line 11

Namespace

Drupal\Core\Entity\Query\Sql\pgsql
View 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

Title Sort descending Modifiers Object type Summary Overriden Title
Condition::$nestedInsideOrCondition protected property Whether this condition is nested inside an OR condition.
Condition::$query protected property The SQL entity query object this condition belongs to. Overrides ConditionFundamentals::$query
Condition::compile public function Compiles this conditional clause. Overrides ConditionInterface::compile
Condition::exists public function Queries for the existence of a field. Overrides ConditionInterface::exists
Condition::notExists public function Queries for the nonexistence of a field. Overrides ConditionInterface::notExists
Condition::translateCondition public static function Translates the string operators to SQL equivalents. Overrides Condition::translateCondition
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. The value is one of the following:
ConditionFundamentals::$namespaces protected property List of potential namespaces of the classes belonging to this condition.
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.

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