Feed export: Convert to string/int, updated docs

This commit is contained in:
Igor Scheller 2023-11-12 11:46:51 +01:00 committed by msquare
parent b17dbf46e0
commit 9acd06cb04
1 changed files with 25 additions and 22 deletions

View File

@ -73,51 +73,54 @@ class FeedController extends BaseController
// ! All attributes not defined in $data might change at any time ! // ! All attributes not defined in $data might change at any time !
$data = [ $data = [
// Name of the shift (type) // Name of the shift (type)
'name' => $shift->shiftType->name, /** @deprecated, use shifttype_name instead */
'name' => (string) $shift->shiftType->name,
// Shift / Talk title // Shift / Talk title
'title' => $shift->title, 'title' => (string) $shift->title,
// Shift description, should be shown after shifttype_description, markdown formatted // Shift description, should be shown after shifttype_description, markdown formatted
'description' => $shift->description, 'description' => (string) $shift->description,
'link' => $this->url->to('/shifts', ['action' => 'view', 'shift_id' => $shift->id]), 'link' => (string) $this->url->to('/shifts', ['action' => 'view', 'shift_id' => $shift->id]),
// Users comment // Users comment, might be empty
'Comment' => $entry->user_comment, 'Comment' => (string) $entry->user_comment,
// Shift id // Shift id
'SID' => $shift->id, 'SID' => (int) $shift->id,
// Shift type // Shift type
'shifttype_id' => $shift->shiftType->id, 'shifttype_id' => (int) $shift->shiftType->id,
'shifttype_name' => $shift->shiftType->name, // General type of the task // General type of the task
'shifttype_description' => $shift->shiftType->description, // General description, markdown formatted 'shifttype_name' => (string) $shift->shiftType->name,
// General description, markdown formatted, might be empty
'shifttype_description' => (string) $shift->shiftType->description,
// Talk URL // Talk URL, mostly empty
'URL' => $shift->url, 'URL' => (string) $shift->url,
// Location (room) id // Location (room) id
'RID' => $shift->location->id, 'RID' => (int) $shift->location->id,
// Location (room) name // Location (room) name
'Name' => $shift->location->name, 'Name' => (string) $shift->location->name,
// Location map url // Location map url, can be empty
'map_url' => $shift->location->map_url, 'map_url' => (string) $shift->location->map_url,
// Start timestamp // Start timestamp
/** @deprecated start_date should be used */ /** @deprecated start_date should be used */
'start' => $shift->start->timestamp, 'start' => (int) $shift->start->timestamp,
// Start date // Start date
'start_date' => $shift->start->toRfc3339String(), 'start_date' => (string) $shift->start->toRfc3339String(),
// End timestamp // End timestamp
/** @deprecated end_date should be used */ /** @deprecated end_date should be used */
'end' => $shift->end->timestamp, 'end' => (int) $shift->end->timestamp,
// End date // End date
'end_date' => $shift->end->toRfc3339String(), 'end_date' => (string) $shift->end->toRfc3339String(),
// Timezone offset like "+01:00" // Timezone offset like "+01:00"
/** @deprecated should be retrieved from start_date or end_date */ /** @deprecated should be retrieved from start_date or end_date */
'timezone' => $timeZone->toOffsetName(), 'timezone' => (string) $timeZone->toOffsetName(),
// The events timezone like "Europe/Berlin" // The events timezone like "Europe/Berlin"
'event_timezone' => $timeZone->getName(), 'event_timezone' => (string) $timeZone->getName(),
]; ];
$response[] = [ $response[] = [