Sonata\BasketBundle\Controller\Api\BasketController::getBasketElement PHP Method

getBasketElement() protected method

Retrieves basket element with id $id or throws an exception if it doesn't exist.
protected getBasketElement ( $id ) : Sonata\Component\Basket\BasketElementInterface
$id
return Sonata\Component\Basket\BasketElementInterface
    protected function getBasketElement($id)
    {
        $basketElement = $this->basketElementManager->findOneBy(array('id' => $id));
        if (null === $basketElement) {
            throw new NotFoundHttpException(sprintf('Basket element (%d) not found', $id));
        }
        return $basketElement;
    }