From 54677c8372fecd71f10781ee5ca296ae7a7077a7 Mon Sep 17 00:00:00 2001 From: NH Gooi Date: Thu, 12 Sep 2024 15:33:53 +0200 Subject: [PATCH] Model changes voor nieuwe API --- common/classes/CalendarEvent.php | 1 + common/classes/NewsItem.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/classes/CalendarEvent.php b/common/classes/CalendarEvent.php index ac63df8..3422aaa 100644 --- a/common/classes/CalendarEvent.php +++ b/common/classes/CalendarEvent.php @@ -15,6 +15,7 @@ class CalendarEvent extends Model { public $keywords; public $url; public $metadata; + public $tags; public function __construct($data, $images = null, $podcast = null) { parent::__construct($data); diff --git a/common/classes/NewsItem.php b/common/classes/NewsItem.php index 222f4a5..da3aba4 100644 --- a/common/classes/NewsItem.php +++ b/common/classes/NewsItem.php @@ -19,11 +19,12 @@ class NewsItem extends Model { public $category; public $theme; public $region; + public $tags; public $podcast; public $images; public $video; - + public $url; public $metadata; @@ -79,6 +80,11 @@ class NewsItem extends Model { } } + if(isset($data->tags)) { + foreach($data->tags as $tag) { + $this->theme = new \Model\NewsRegion($tag->titel, $tag->slug); + } + } $images = ($images != null) ? $images : (isset($data->images) ? $data->images : null);