コード例 #1
0
 /**
  * @param integer $id
  *
  * @ApiDoc(
  *  description="Restaurant detail",
  *  statusCodes={200="Restaurant"},
  *  section="Restaurant")
  * @Route("/api/restaurants/{id}")
  * @Method({"GET"})
  * @return View
  */
 public function getAction($id)
 {
     $request = $this->requestStack->getCurrentRequest();
     $restaurant = $this->restaurantRepository->get($id);
     $data = array('restaurant' => $restaurant);
     $this->cacheManager->tagController($request, CacheTag::RESTAURANT, false);
     return $this->view($data, 200, array(), array(SerializationGroup::RESTAURANT));
 }