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; }