/** * Check if a ResourceNode can be added in a Workspace (resource amount limit) * * @param Workspace $workspace */ public function checkResourceLimitExceeded(Workspace $workspace) { $ch = $this->container->get('claroline.config.platform_config_handler'); $workspaceManager = $this->container->get('claroline.manager.workspace_manager'); $maxFileStorage = $workspace->getMaxUploadResources(); return $maxFileStorage < $workspaceManager->countResources($workspace) ? true : false; }
public function exportWorkspace(Workspace $workspace) { return ['id' => $workspace->getId(), 'guid' => $workspace->getGuid(), 'name' => $workspace->getName(), 'description' => $workspace->getDescription(), 'code' => $workspace->getCode(), 'maxStorageSize' => $workspace->getMaxStorageSize(), 'maxUploadResources' => $workspace->getMaxUploadResources(), 'maxUsers' => $workspace->getMaxUsers(), 'displayable' => $workspace->isDisplayable(), 'creatorId' => $workspace->getCreator()->getId(), 'selfRegistration' => $workspace->getSelfRegistration(), 'registrationValidation' => $workspace->getRegistrationValidation(), 'selfUnregistration' => $workspace->getSelfUnregistration(), 'creationDate' => $workspace->getCreationDate(), 'isPersonal' => $workspace->isPersonal(), 'startDate' => $workspace->getStartDate(), 'endDate' => $workspace->getEndDate(), 'isAccessDate' => $workspace->getIsAccessDate(), 'type' => $workspace->getWorkspaceType()]; }