3 namespace Drupal\Core\Entity\Query\Sql\pgsql;
5 use Drupal\Core\Database\Query\SelectInterface;
6 use Drupal\Core\Entity\Query\Sql\Condition as BaseCondition;
9 * Implements entity query conditions for PostgreSQL databases.
11 class Condition extends BaseCondition {
16 public static function translateCondition(&$condition, SelectInterface $sql_query, $case_sensitive) {
17 if (is_array($condition['value']) && $case_sensitive === FALSE) {
18 $condition['where'] = 'LOWER(' . $sql_query->escapeField($condition['real_field']) . ') ' . $condition['operator'] . ' (';
19 $condition['where_args'] = [];
22 // Only use the array values in case an associative array is passed as an
23 // argument following similar pattern in
24 // \Drupal\Core\Database\Connection::expandArguments().
25 foreach ($condition['value'] as $value) {
26 $condition['where'] .= 'LOWER(:value' . $n . '),';
27 $condition['where_args'][':value' . $n] = $value;
30 $condition['where'] = trim($condition['where'], ',');
31 $condition['where'] .= ')';
34 parent::translateCondition($condition, $sql_query, $case_sensitive);