Elcodi\Store\ProductBundle\Behat\Context::getPurchasable PHP Method

getPurchasable() protected method

Get purchasable by id
protected getPurchasable ( integer $purchasableId ) : Elcodi\Component\Product\Entity\Interfaces\PurchasableInterface
$purchasableId integer Purchasable Id
return Elcodi\Component\Product\Entity\Interfaces\PurchasableInterface Purchasable
    protected function getPurchasable($purchasableId)
    {
        $purchasable = $this->getContainer()->get('elcodi.repository.purchasable')->find($purchasableId);
        if (!$purchasable instanceof PurchasableInterface) {
            throw new EntityNotFoundException(sprintf('Purchasable with id %d was not found', $purchasableId));
        }
        return $purchasable;
    }