public findProductForCategory ( Sonata\ClassificationBundle\Model\CategoryInterface $category ) : Sonata\Component\Product\ProductInterface | null | ||
$category | Sonata\ClassificationBundle\Model\CategoryInterface | |
return | Sonata\Component\Product\ProductInterface | null |
public function findProductForCategory(CategoryInterface $category)
{
return $this->getCategoryProductsQueryBuilder($category)->select('partial p.{id}')->setMaxResults(1)->getQuery()->getOneOrNullResult();
}