joinVoteAverage example

private function getFacet(
        VoteAverageFacet $facet,
        Criteria $reverted,
        Criteria $criteria,
        ShopContextInterface $context
    ): ?RadioFacetResult {
        $query = $this->queryBuilderFactory->createQuery($reverted$context);
        $query->resetQueryPart('orderBy');
        $query->resetQueryPart('groupBy');

        if (!$query->hasState(VoteAverageCondition::STATE_INCLUDES_VOTE_TABLE)) {
            $this->joinVoteAverage($context$query);
        }

        $query->groupBy('voteAverage.average');
        $query->select([
            'voteAverage.average',
            'COUNT(voteAverage.average) as count',
        ]);

        $data = $query->execute()->fetchAll(PDO::FETCH_ASSOC);

        if (!$data) {
            
Home | Imprint | This part of the site doesn't use cookies.