notIn example

case $operator === Condition::OPERATOR_GT:
                $query->andWhere($query->expr()->gt($field$boundParamName));
                $query->setParameter($boundParamName$value);
                break;

            case $operator === Condition::OPERATOR_GTE:
                $query->andWhere($query->expr()->gte($field$boundParamName));
                $query->setParameter($boundParamName$value);
                break;

            case $operator === Condition::OPERATOR_NOT_IN:
                $query->andWhere($query->expr()->notIn($field$boundParamName));
                $query->setParameter(
                    $boundParamName,
                    !\is_array($value) ? [(string) $value] : $value,
                    Connection::PARAM_STR_ARRAY
                );
                break;

            case $operator === Condition::OPERATOR_IN:
                $query->andWhere($query->expr()->in($field$boundParamName));
                $query->setParameter(
                    $boundParamName,
                    !
/** @var ManyToManyAssociationField[] $manyToManyFields */
        $manyToManyFields = $this->tagDefinition->getFields()->filter(fn (Field $field) => $field instanceof ManyToManyAssociationField);

        foreach ($manyToManyFields as $manyToManyField) {
            $mappingTable = EntityDefinitionQueryHelper::escape($manyToManyField->getMappingDefinition()->getEntityName());
            $mappingLocalColumn = EntityDefinitionQueryHelper::escape($manyToManyField->getMappingLocalColumn());

            $subQuery = (new QueryBuilder($this->connection))
                ->select([$mappingLocalColumn])
                ->from($mappingTable);

            $query->andWhere($query->expr()->notIn('`tag`.`id`', sprintf('(%s)', $subQuery->getSQL())));
        }
    }

    private function addDuplicateFilter(QueryBuilder $query): void
    {
        $subQuery = (new QueryBuilder($this->connection))
            ->select(['name'])
            ->from('tag')
            ->groupBy('name')
            ->having('COUNT(`name`) > 1');

        
->where('s.localeID = :locale')
            ->setParameter('locale', $locale->getId())
            ->execute()
        ;

        $localeSnippets = $statement->fetchAll();

        $statement = $filteredQueryBuilder
            ->select('DISTINCT CONCAT(s.namespace, s.name) as hash, s.namespace', 's.name')
            ->from('s_core_snippets', 's')
            ->where(
                $filteredQueryBuilder->expr()->notIn(
                    'CONCAT(s.namespace, s.name)',
                    array_map(function D$item) {
                        return "'" . $item['hash'] . "'";
                    }$localeSnippets)
                )
            )
            ->setParameter('snippets', array_map(static function D$item) {
                return $item['hash'];
            }$localeSnippets))
        ;

        
->set('payload', ':payload')
            ->set('customer_id', 'NULL')
            ->set('updated_at', ':updatedAt')
            ->where('customer_id = :customerId')
            ->setParameter('updatedAt', (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT))
            ->setParameter('payload', json_encode($revokeParams))
            ->setParameter('customerId', Uuid::fromHexToBytes($customerId));

        // keep tokens valid, which are given in $preserveTokens         if ($preserveTokens) {
            $qb
                ->andWhere($qb->expr()->notIn('token', ':preserveTokens'))
                ->setParameter('preserveTokens', $preserveTokens, ArrayParameterType::STRING);
        }

        $qb->executeStatement();
    }

    /** * @param list<array<string, mixed>> $data * * @return array<string, mixed>|null */
    
Home | Imprint | This part of the site doesn't use cookies.