Beispiel #1
0
 public function toArray(Workspace $workspace)
 {
     $data = array();
     $data['id'] = $workspace->getId();
     $data['name'] = $workspace->getName();
     $data['code'] = $workspace->getCode();
     $data['expiration_date'] = $workspace->getEndDate()->getTimeStamp();
     return $data;
 }
 public function isDateAccessValid(Workspace $workspace)
 {
     $isEndValid = $workspace->getEndDate() ? $workspace->getEndDate() > new \DateTime() : true;
     $isStartValid = $workspace->getStartDate() ? $workspace->getStartDate() < new \DateTime() : true;
     return $isEndValid && $isStartValid;
 }