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

getBasket() protected method

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