/**
  * @EXT\Route("/dashboards/{dashboardId}/times", name="get_dashboard_spent_times")
  * @EXT\ParamConverter("user", converter="current_user", options={"allowAnonymous"=false})
  * @EXT\ParamConverter("dashboard", class="ClarolineDashboardBundle:Dashboard", options={"mapping": {"dashboardId": "id"}})
  * @EXT\Method("GET")
  */
 public function getDashboardWorkspaceSpentTimes(User $user, Dashboard $dashboard)
 {
     $all = $user->getId() === $dashboard->getWorkspace()->getCreator()->getId();
     $data = $this->dashboardManager->getDashboardWorkspaceSpentTimes($dashboard->getWorkspace(), $user, $all);
     return new JsonResponse($data);
 }
 /**
  * Export dashboard as array.
  */
 public function exportDashboard(Dashboard $dashboard)
 {
     return ['id' => $dashboard->getId(), 'creatorId' => $dashboard->getCreator()->getId(), 'name' => $dashboard->getName(), 'workspace' => $this->workspaceManager->exportWorkspace($dashboard->getWorkspace())];
 }