/**
  * @param GoogleConnection $googleConnection
  *
  * @return Response
  *
  * @Route("/google-calendar/{id}", name="app_calendars_list_google_connections", methods="GET")
  * @Security("has_role('ROLE_CALD_CALD_SHOW')")
  */
 public function listByGoogleConnectionAction(GoogleConnection $googleConnection)
 {
     return $this->render('calendars/listByGoogleConnection.html.twig', ['calendars' => $googleConnection->getCalendars(), 'googleConnection' => $googleConnection]);
 }
 /**
  * @param GoogleConnection $connection
  *
  * @return Model;
  */
 public function entityToModel(GoogleConnection $connection)
 {
     $model = new Model();
     $model->setId($connection->getId())->setTitle($connection->getTitle())->setClientId($connection->getClientId())->setClientSecret($connection->getClientSecret())->setProjectId($connection->getProjectId())->setProjectId($connection->getProjectId())->setInternalId($connection->getInternalId())->setJobDayComplete($connection->isJobDayComplete())->setNurseryDayComplete($connection->isNurseryDayComplete())->setActive($connection->isActive());
     return $model;
 }
 /**
  * @param GoogleConnection $googleConnection
  * @param Request          $request
  *
  * @return JsonResponse
  *
  * @Route("/{id}/deactivate", requirements={"id": "^\d+$"}, name="app_google_connections_deactivate", methods="PATCH")
  * @Security("has_role('ROLE_CALD_GOOGL_ACTIV')")
  */
 public function deactivateAction(GoogleConnection $googleConnection, Request $request)
 {
     $this->assertXmlHttpRequest($request);
     $googleConnection->setActive(false);
     $this->get('doctrine.orm.entity_manager')->flush();
     return new JsonResponse(['message' => $this->get('translator')->trans('google_connections.message.inactive')]);
 }