Apply the operator onto the query

@param \SelectQueryInterface $query
@param string $statement
@param string $value
19454
final protected function applyOperator(\SelectQueryInterface $query, $statement, $value)
    {
        // Check if $value contains an operator (i.e. if is associative array)
        if (is_array($value) && !Misc::isIndexed($value)) {

            // First key will be the operator
            $keys     = array_keys($value);
            $operator = $keys[0];
            $value    = $value[$operator];

            switch ($operator) {

                case '<>':
                    if (is_array($value)) {
                        $query->condition($statement, $value, 'NOT IN');
                    } else {
                        $query->condition($statement, $value, '<>');
                    }
                    break;

                case 'exists':
                    $query->exists($value);
                    break;

                case 'in':
                    $query->condition($statement, $value, 'IN');
                    break;

                default:
                    $query->condition($statement, $value, $operator);
                    break;
            }
        } else if (null === $value) {
            $query->isNull($statement);
        } else {
            $query->condition($statement, $value);
        }
    }
171671
public function prepare($statement, $options = null)
    {
        $options = is_null($options) ? [] : $options;
        if (strpos($statement, ':') !== false) {
            $i = 0;
            $bindKeyMap = [];
            $statement = preg_replace_callback('/:([a-zA-Z_]\w*?)\b/', function ($matches) use (&$i, &$bindKeyMap) {
                $bindKeyMap[$matches[1]] = $i++;

                return '?';
            }, $statement);
        }

        $stmtObj = $this->client->prepare($statement);

        if ($stmtObj) {
            $stmtObj->bindKeyMap = $bindKeyMap ?? [];

            return new PDOStatement($this, $stmtObj, $options);
        } else {
            $statementException = new StatementException($this->client->error, $this->client->errno);
            throw new QueryException($statement, [], $statementException);
        }
    }
1018019
private void executeStatement(String statement) throws SQLException {

        Statement stmt = null;

        try {
            stmt = m_con.createStatement();
            stmt.execute(statement);
        } finally {
            if (stmt != null) {
                stmt.close();
            }
        }
    }
1365287
protected function bind(Statement $preparedStatement, $query)
    {
        foreach ($this->values as $placeholder => $value) {
            if (strpos($query, $placeholder) !== false) {
                $preparedStatement->bindValue($placeholder, $value[0], $value[1]);
            }
        }

        foreach ($this->variables as $placeholder => $value) {
            if (strpos($query, $placeholder) !== false) {
                $variable = & $value[0];
                $preparedStatement->bindParam($placeholder, $variable, $value[1]);
            }
        }

        foreach ($this->arrays as $placeholder => $values) {
            $count = count($values);
            for ($i = 0; $i < $count; $i++) {
                $value = $values[$i];
                $nextPlaceholder = $placeholder . $i;
                if (is_null($value)) {
                    $preparedStatement->bindValue($nextPlaceholder, $value, \PDO::PARAM_NULL);
                } elseif (is_int($value)) {
                    $preparedStatement->bindValue($nextPlaceholder, $value, \PDO::PARAM_INT);
                } else {
                    $preparedStatement->bindValue($nextPlaceholder, $value, \PDO::PARAM_STR);
                }
            }
        }
    }
447584
void executeStatement(String statement) {

		try (Connection conn = getFastConnection(); Statement stm = conn.createStatement()) {
			stm.execute(statement);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}

	}
705577
public function select($fields = null, $where = null, $orderBy = null, $limit = null): Statement
    {
        $this->operation = 'select';
        return $this->setSelectArgument($fields, $where, $orderBy, $limit);
    }
740558
public function process(QueryInterface $query)
    {
        if (!$query instanceof DropQuery || $query->getObject() !== DropQuery::EXPRESSION_TABLE) {
            return null;
        }

        $command = new ApplySchema($query->getSql());
        $this->client->executeCommand($command);

        return new EmptyResult();
    }
1281616
public function applyJoin(
        SelectQuery $query,
        SortClause $sortClause,
        $number,
        array $languageSettings
    ) {
        /** @var \eZ\Publish\API\Repository\Values\Content\Query\SortClause\Target\FieldTarget $fieldTarget */
        $fieldTarget = $sortClause->targetData;
        $fieldMap = $this->contentTypeHandler->getSearchableFieldMap();

        if (!isset($fieldMap[$fieldTarget->typeIdentifier][$fieldTarget->fieldIdentifier]['field_definition_id'])) {
            throw new InvalidArgumentException(
                '$sortClause->targetData',
                'No searchable fields found for the given sort clause target ' .
                "'{$fieldTarget->fieldIdentifier}' on '{$fieldTarget->typeIdentifier}'."
            );
        }

        $fieldDefinitionId = $fieldMap[$fieldTarget->typeIdentifier][$fieldTarget->fieldIdentifier]['field_definition_id'];
        $table = $this->getSortTableName($number);

        $query
            ->leftJoin(
                $query->alias(
                    $this->dbHandler->quoteTable('ezcontentobject_attribute'),
                    $this->dbHandler->quoteIdentifier($table)
                ),
                $query->expr->lAnd(
                    $query->expr->eq(
                        $query->bindValue($fieldDefinitionId, null, PDO::PARAM_INT),
                        $this->dbHandler->quoteColumn('contentclassattribute_id', $table)
                    ),
                    $query->expr->eq(
                        $this->dbHandler->quoteColumn('contentobject_id', $table),
                        $this->dbHandler->quoteColumn('id', 'ezcontentobject')
                    ),
                    $query->expr->eq(
                        $this->dbHandler->quoteColumn('version', $table),
                        $this->dbHandler->quoteColumn('current_version', 'ezcontentobject')
                    ),
                    $this->getFieldCondition($query, $languageSettings, $table)
                )
            );
    }
1308146
public function modifyElementsQuery (ElementQueryInterface $query, $value)
	{
		if (empty($value))
			return;

		/** @var ElementQuery $query */

		$table = MapRecord::TableName;
		$alias = MapRecord::TableNameClean . '_' . bin2hex(openssl_random_pseudo_bytes(5));
		$on = [
			'and',
			'[[elements.id]] = [[' . $alias . '.ownerId]]',
			'[[elements.dateDeleted]] IS NULL',
			'[[elements_sites.siteId]] = [[' . $alias . '.ownerSiteId]]',
		];

		$query->query->join('JOIN', $table . ' ' . $alias, $on);
		$query->subQuery->join('JOIN', $table . ' ' . $alias, $on);

		$oldOrderBy = null;
		$search = false;

		if (!is_array($query->orderBy))
		{
			$oldOrderBy = $query->orderBy;
			$query->orderBy = [];
		}

		if (array_key_exists('location', $value))
			$search = $this->_searchLocation($query, $value, $alias);

		if (array_key_exists('distance', $query->orderBy))
			$this->_replaceOrderBy($query, $search);

		if ($oldOrderBy !== null)
			$query->orderBy = $oldOrderBy;
	}
234856
public static void setArguments(PreparedStatement statement,
			Object[] selectionArgs) throws SQLException {
		if (selectionArgs != null) {
			for (int i = 0; i < selectionArgs.length; i++) {
				statement.setObject(i + 1, selectionArgs[i]);
			}
		}
	}
993586
public function apply($name, $value, $query, FilterInterface $filter)
    {
        $column = ( ! empty($this->table) ? $this->table . '.' : null)
                . ( ! empty($this->column) ? $this->column : $name);

        return $query->where(function ($query) use ($column) {
            
            return $query->whereNull($column)
                         ->orWhere($column, '');
        });
    }
334486
public function query($query, $params = []) {
		$statement = $this->get_statement($query, $params);
		$statement->execute();
	}
646671
protected function applyFilters(\SelectQueryInterface $select, Query $query)
    {
        if ($query->has('name')) {
            $select->condition('name', '%'.db_like($query->get('name')).'%', 'LIKE');
        }

        if ($query->has('roles')) {
            $select->leftJoin(
                'users_roles',
                'ur',
                'ur.uid = u.uid'
            );
            $select->condition('ur.rid', $query->get('roles'));
        }
        if ($query->has('status')) {
            $select->condition('u.status', $query->get('status'));
        }
    }
669021
private function setContentObjectWordsSelectQuery(SelectQuery $query)
    {
        $query->select('word_id')
            ->from($this->dbHandler->quoteTable('ezsearch_object_word_link'))
            ->where($query->expr->eq($this->dbHandler->quoteColumn('contentobject_id'), ':contentId'));
    }
202026
final protected function process(\SelectQueryInterface $select, Query $query)
    {
        if ($query->hasSortField()) {
            $select->orderBy(
                $query->getSortField(),
                Query::SORT_DESC === $query->getSortOrder() ? 'desc' : 'asc'
            );
        }
        $select->orderBy(
            'u.uid',
            Query::SORT_DESC === $query->getSortOrder() ? 'desc' : 'asc'
        );

        if ($searchstring = $query->getSearchString()) {
            $select->condition(
                'u.name',
                '%'.db_like($searchstring).'%',
                'LIKE'
            );
        }

        $this->applyFilters($select, $query);

        return $select /*->extend(DrupalPager::class)->setQuery($query) */;
    }
369742
public function query($statement, ...$fetch)
    {
        $this->connect();

        // trigger before event
        $this->fire(self::BEFORE_EXECUTE, [$statement, 'query']);

        $sth = $this->pdo->query($this->replaceTablePrefix($statement), ...$fetch);

        // trigger after event
        $this->fire(self::AFTER_EXECUTE, [$statement, 'query']);

        return $sth;
    }
234071
private function applyNestedFilter(Builder $query, array $fields, $operator, $value, $or = false)
    {
        $relation_name = implode('.', array_slice($fields, 0, count($fields) - 1));
        $relation_field = end($fields);
        if ($relation_name[0] == '!') {
            $relation_name = substr($relation_name, 1, strlen($relation_name));

            $that = $this;

            return $query->whereHas($relation_name, function ($query) use ($relation_field, $operator, $value, $that, $or) {
                $query = $that->applyWhereClause($query, $relation_field, $operator, $value, $or);
            }, '=', 0);
        }

        $that = $this;

        return $query->whereHas($relation_name, function ($query) use ($relation_field, $operator, $value, $that, $or) {
            $query = $that->applyWhereClause($query, $relation_field, $operator, $value, $or);
        });
    }