예제 #1
0
 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()];
 }
 public function isDateAccessValid(Workspace $workspace)
 {
     $isEndValid = $workspace->getEndDate() ? $workspace->getEndDate() > new \DateTime() : true;
     $isStartValid = $workspace->getStartDate() ? $workspace->getStartDate() < new \DateTime() : true;
     return $isEndValid && $isStartValid;
 }