Advertisement
Flicster

Untitled

Jan 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. /**
  2.      * @Route(path="/microsoft_sync", name="microsoft_sync_excel", options={"expose": true})
  3.      *
  4.      */
  5.     public function syncAction(Request $request)
  6.     {
  7.         $em = $this->getEm();
  8.  
  9.         /** @var MicrosoftAPIService $microsoftAPIService */
  10.         $microsoftAPIService = $this->get('influencing.service.microsoft');
  11.  
  12.         /** @var User $user */
  13.         $user = $this->getCurrentUser();
  14.  
  15.         /** @var Profile $profile */
  16.         $profile = $em->find('InfluencingCoreBundle:Profile', $request->get('profile_id'));
  17.  
  18.         $microsoftAccountIds = $request->get('onedrive_accounts_ids');
  19.         $fields = $request->get('fields');
  20.         $filename = $request->get('filename');
  21.  
  22.         $statusOk = $microsoftAPIService->sync($microsoftAccountIds, $fields, $profile, $filename, $user);
  23.  
  24.         $result = [
  25.             'success' => $statusOk,
  26.         ];
  27.  
  28.         return new JsonResponse($result);
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement