Пример #1
0
 /**
  * @ApiDoc(
  *  section="Phone",
  *  description="List of all phones for specified client",
  *  filters={
  *      {"name"="token", "type"="text"}
  *  }
  * )
  * @Method("GET")
  * @Route("/phones/client/{id}", requirements={"id" = "\d+"})
  * @ParamConverter("client", converter="account.doctrine.orm")
  * @deprecated will be removed in the feature
  */
 public function getClientPhonesAction(Client $client)
 {
     if (!$this->get('perfico_crm.permission_manager')->checkAnyRole(['ROLE_PHONE_VIEW_ALL', 'ROLE_PHONE_VIEW_OWN'])) {
         return new JsonResponse([], Response::HTTP_FORBIDDEN);
     }
     $phones = $client->getPhones();
     return new JsonResponse($this->get('perfico_crm.api.transformer')->transformCollection($phones, new PhoneMap(), 'phones'));
 }