public function getTopByCriteria($range = null, $topType = null, $max = 30) { if ($topType == null) { $topType = 'top_users_connections'; } $listData = array(); switch ($topType) { case 'top_extension': $listData = $this->resourceRepo->findMimeTypesWithMostResources($max); break; case 'top_workspaces_resources': $listData = $this->workspaceRepo->findWorkspacesWithMostResources($max); break; case 'top_workspaces_connections': $listData = $this->topWSByAction($range, LogWorkspaceToolReadEvent::ACTION, $max); break; case 'top_resources_views': $listData = $this->topResourcesByAction($range, LogResourceReadEvent::ACTION, $max); break; case 'top_resources_downloads': $listData = $this->topResourcesByAction($range, LogResourceExportEvent::ACTION, $max); break; case 'top_users_connections': $listData = $this->topUsersByAction($range, LogUserLoginEvent::ACTION, $max); break; case 'top_users_workspaces_enrolled': $listData = $this->userRepo->findUsersEnrolledInMostWorkspaces($max); break; case 'top_users_workspaces_owners': $listData = $this->userRepo->findUsersOwnersOfMostWorkspaces($max); break; case 'top_media_views': $listData = $this->topMediaByAction($range, LogResourceReadEvent::ACTION, $max); break; } return $listData; }
/** * @param integer $max * * @return \Claroline\CoreBundle\Entity\Workspace\Workspace[] */ public function getWorkspacesWithMostResources($max) { return $this->workspaceRepo->findWorkspacesWithMostResources($max); }