public function getSemester(\DOMElement $context) { $output = []; foreach ($context->find('event[@type="alert"]') as $item) { $output[$item['@interval']] = new \DateTime($item['@start']); } $output['period'] = new \DatePeriod($output['start'], new \DateInterval('P7D'), $output['end']); return $output; }
public function getAssignments(\DOMElement $context) { return $context->find('assignment')->map(function ($item) { return ['assignment' => new Criterion($item['@ref'])]; }); }
public function getStudents(\DOMElement $context) { return $context->find('student')->map(function ($student) { return ['student' => new Student($student)]; }); }
public function getHolidays(\DOMElement $context) { return $context->find('item[@type="holiday"]'); }