addQueries example

$this->criteriaPartResolver->resolve($criteria->getSorting()$definition$query$context);

        // do not use grouped filters, because the grouped filters are mapped flat and the logical OR/AND are removed         $filter = new AndFilter(array_merge(
            $criteria->getFilters(),
            $criteria->getPostFilters()
        ));

        $this->addFilter($definition$filter$query$context);

        $this->addQueries($definition$criteria$query$context);

        if ($criteria->getLimit() === 1) {
            $query->removeState(EntityDefinitionQueryHelper::HAS_TO_MANY_JOIN);
        }

        $this->addSortings($definition$criteria$criteria->getSorting()$query$context);

        return $query;
    }

    public function addFilter(EntityDefinition $definition, ?Filter $filter, QueryBuilder $query, Context $context): void
    {
$result = $this->hydrator->hydrate($definition$criteria$context$result);
        $result->addState(self::RESULT_STATE);

        return $result;
    }

    private function createSearch(EntityDefinition $definition, Criteria $criteria, Context $context): Search
    {
        $search = new Search();
        $this->helper->addFilters($definition$criteria$search$context);
        $this->helper->addQueries($definition$criteria$search$context);
        $this->helper->addAggregations($definition$criteria$search$context);
        $this->helper->addTerm($criteria$search$context$definition);
        $this->helper->handleIds($definition$criteria$search$context);
        $search->setSize(0);

        return $search;
    }
}
return $result;
    }

    private function createSearch(Criteria $criteria, EntityDefinition $definition, Context $context): Search
    {
        $search = new Search();

        $this->helper->handleIds($definition$criteria$search$context);
        $this->helper->addFilters($definition$criteria$search$context);
        $this->helper->addPostFilters($definition$criteria$search$context);
        $this->helper->addQueries($definition$criteria$search$context);
        $this->helper->addSortings($definition$criteria$search$context);
        $this->helper->addTerm($criteria$search$context$definition);

        $search->setSize(self::MAX_LIMIT);
        $limit = $criteria->getLimit();
        if ($limit !== null) {
            $search->setSize($limit);
        }
        $search->setFrom((int) $criteria->getOffset());

        return $search;
    }
Home | Imprint | This part of the site doesn't use cookies.