コード例 #1
0
 /**
  * REST GET item
  *
  * @ApiDoc(
  *   description="Get device by id",
  *   output = "Zbox\UnifiedPushBundle\Entity\Device",
  *   statusCodes = {
  *     200 = "Returned when successful",
  *     404 = "Returned when the notification is not found"
  *   }
  * )
  *
  * @Annotations\View(templateVar="device")
  *
  * @param int     $id      the notification id
  * @return Response
  */
 public function getByIdAction($id)
 {
     $device = $this->deviceProvider->getById($id);
     if (false === $device) {
         throw $this->createNotFoundException("Device does not exist.");
     }
     return new View($device);
 }