Exemplo n.º 1
0
 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;
 }
 public function getPagerAllWorkspacesWithSelfReg(User $user, $page = 1)
 {
     $workspaces = $this->workspaceRepo->findWorkspacesWithSelfRegistration($user);
     return $this->pagerFactory->createPagerFromArray($workspaces, $page);
 }
Exemplo n.º 3
0
 public function getWorkspaceCodesWithPrefix($prefix, $executeQuery = true)
 {
     return $this->workspaceRepo->findWorkspaceCodesWithPrefix($prefix, $executeQuery);
 }
Exemplo n.º 4
0
 public function getNonPersonalByCodeAndName($code, $name, $offset = null, $limit = null)
 {
     return !$code && !$name ? $this->workspaceRepo->findBy(['isPersonal' => false]) : $this->workspaceRepo->findNonPersonalByCodeAndName($code, $name, $offset, $limit);
 }