Sonata\ProductBundle\Entity\ProductManager::findEnabledFromIdAndSlug PHP Method

findEnabledFromIdAndSlug() public method

Retrieve an active product from its id and its slug.
public findEnabledFromIdAndSlug ( integer $id, string $slug ) : Sonata\Component\Product\ProductInterface | null
$id integer
$slug string
return Sonata\Component\Product\ProductInterface | null
    public function findEnabledFromIdAndSlug($id, $slug)
    {
        return $this->getRepository()->findOneBy(array('id' => $id, 'slug' => $slug, 'enabled' => true));
    }