Пример #1
0
 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;
 }
Пример #2
0
 public function getAssignments(\DOMElement $context)
 {
     return $context->find('assignment')->map(function ($item) {
         return ['assignment' => new Criterion($item['@ref'])];
     });
 }
Пример #3
0
 public function getStudents(\DOMElement $context)
 {
     return $context->find('student')->map(function ($student) {
         return ['student' => new Student($student)];
     });
 }
Пример #4
0
 public function getHolidays(\DOMElement $context)
 {
     return $context->find('item[@type="holiday"]');
 }