public function getAllFromCategories(array $categories)
    {
        $queryBuilder = $this->createQueryBuilder('p');
        $this->addPerformanceJoinsToQueryBuilder($queryBuilder);

        return $queryBuilder
            ->innerJoin('p.categories', 'c')
            ->where('c.id IN (:categories)')
            ->setParameters([
                'categories' => $categories,
            ])
            ->getQuery()
            ->getResult();
    }
public function getAllFromCategories(array $categories)
    {
        $queryBuilder = $this->createQueryBuilder('p');
        $this->addPerformanceJoinsToQueryBuilder($queryBuilder);

        return $queryBuilder
            ->innerJoin('p.categories', 'c')
            ->where('c.id IN (:categories)')
            ->setParameters([
                'categories' => $categories,
            ])
            ->getQuery()
            ->getResult();
    }
public function getAllFromCategories ( array $ categories ) { $ queryBuilder = $ this -> createQueryBuilder ( 'p' ) ; $ this -> addPerformanceJoinsToQueryBuilder ( $ queryBuilder ) ; return $ queryBuilder -> innerJoin ( 'p.categories' , 'c' ) -> where ( 'c.id IN (:categories)' ) -> setParameters ( [ 'categories' => $ categories , ] ) -> getQuery ( ) -> getResult ( ) ; }
Get all the the Purchasables from the received categories.

@param CategoryInterface[] $categories

@return array All Purchasables by a set of category ids
Get all the the Purchasables from the received categories .