/**
  * @ApiDoc(
  *  section="List actions",
  *  description="List of all activities for specified client",
  *  filters={
  *      {"name"="token", "type"="text"}
  *  }
  * )
  * @Method("GET")
  * @Route("/clients/{id}/activities-list")
  * @param Client $client
  * @ParamConverter("client", converter="account.doctrine.orm")
  * @return JsonResponse
  */
 public function activitiesAction(Client $client)
 {
     return new JsonResponse($this->get('perfico_crm.api.transformer')->transformCollection($client->getActivities(), new ActivityListMap(), 'activities'));
 }
示例#2
0
 /**
  * @ApiDoc(
  *  section="Client",
  *  description="Get all activities for client",
  *  filters={
  *      {"name"="token", "type"="text"}
  *  }
  * )
  * @Method("GET")
  * @Route("/clients/{id}/activities")
  * @ParamConverter("client", converter="account.doctrine.orm")
  * @param Client $client
  * @return JsonResponse
  */
 public function activitiesAction(Client $client)
 {
     if (!$this->get('perfico_crm.permission_manager')->checkAnyRole(['ROLE_ACTIVITY_VIEW_ALL', 'ROLE_ACTIVITY_VIEW_OWN'])) {
         return new JsonResponse([], Response::HTTP_FORBIDDEN);
     }
     return new JsonResponse($this->get('perfico_crm.api.transformer')->transformCollection($client->getActivities(), new ActivityMap(), 'activities'));
 }