diff options
Diffstat (limited to 'lib/classes/JsonApi/Schemas/CourseEvent.php')
| -rw-r--r-- | lib/classes/JsonApi/Schemas/CourseEvent.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/classes/JsonApi/Schemas/CourseEvent.php b/lib/classes/JsonApi/Schemas/CourseEvent.php index 77f1d31..e90ae0d 100644 --- a/lib/classes/JsonApi/Schemas/CourseEvent.php +++ b/lib/classes/JsonApi/Schemas/CourseEvent.php @@ -18,16 +18,16 @@ class CourseEvent extends SchemaProvider public function getAttributes($resource, ContextInterface $context): iterable { return [ - 'title' => $resource->title, + 'title' => isset($resource->course) ? $resource->course->getFullName() : '', 'description' => $resource->getDescription(), - 'start' => date('c', $resource->getStart()), - 'end' => date('c', $resource->getEnd()), - 'categories' => array_filter($resource->toStringCategories(true)), - 'location' => $resource->getLocation(), - + 'start' => date('c', $resource->date), + 'end' => date('c', $resource->end_time), + 'categories' => '', + 'location' => $resource->raum ?? '', + 'is-cancelled' => $resource instanceof \CourseExDate, 'mkdate' => date('c', $resource->mkdate), 'chdate' => date('c', $resource->chdate), - 'recurrence' => $resource->getRecurrence(), + 'recurrence' => isset($resource->cycle) ? $resource->cycle->toString() : '', ]; } |
