Beispiel #1
0
 /**
  * @param string[]                                                 $roles
  * @param \Claroline\CoreBundle\Entity\Workspace\Workspace $workspace
  *
  * @return \Claroline\CoreBundle\Entity\Tool\OrderedTool[]
  */
 public function getOrderedToolsByWorkspaceAndRoles(Workspace $workspace, array $roles, $type = 0)
 {
     if ($workspace->isPersonal()) {
         return $this->orderedToolRepo->findPersonalDisplayableByWorkspaceAndRoles($workspace, $roles, $type);
     }
     return $this->orderedToolRepo->findByWorkspaceAndRoles($workspace, $roles, $type);
 }
 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()];
 }