Sonata\ProductBundle\Controller\CatalogController::getProviderFromCategory PHP Method

getProviderFromCategory() protected method

Gets the product provider associated with $category if any.
protected getProviderFromCategory ( Sonata\ClassificationBundle\Model\CategoryInterface $category = null ) : null | Sonata\Component\Product\ProductProviderInterface
$category Sonata\ClassificationBundle\Model\CategoryInterface
return null | Sonata\Component\Product\ProductProviderInterface
    protected function getProviderFromCategory(CategoryInterface $category = null)
    {
        if (null === $category) {
            return;
        }
        $product = $this->getProductSetManager()->findProductForCategory($category);
        return $product ? $this->getProductPool()->getProvider($product) : null;
    }