public function countUsers(Workspace $workspace, $includeGrps = false)
 {
     if ($includeGrps) {
         $wsRoles = $this->roleManager->getRolesByWorkspace($workspace);
         return $this->container->get('claroline.manager.user_manager')->countByRoles($wsRoles, true);
     }
     return $this->workspaceRepo->countUsers($workspace->getId());
 }
Beispiel #2
0
 /**
  * Import the content of an archive in a workspace.
  *
  * @param Configuration $configuration
  * @param Workspace $workspace
  * @return Workspace
  */
 public function importInExistingWorkspace(Configuration $configuration, Workspace $workspace)
 {
     $root = $this->resourceManager->getResourceFromNode($this->resourceManager->getWorkspaceRoot($workspace));
     $wsRoles = $this->roleManager->getRolesByWorkspace($workspace);
     $entityRoles = [];
     foreach ($wsRoles as $wsRole) {
         $entityRoles[$this->roleManager->getWorkspaceRoleBaseName($wsRole)] = $wsRole;
     }
     $workspace = $this->container->get('claroline.manager.transfert_manager')->populateWorkspace($workspace, $configuration, $root, $entityRoles);
     $this->importRichText();
     return $workspace;
 }