Fragment terugluisteren toegevoegd aan nieuws en agenda
This commit is contained in:
@@ -17,14 +17,14 @@ class NewsItem extends Model {
|
||||
public $category;
|
||||
public $theme;
|
||||
public $region;
|
||||
|
||||
|
||||
public $podcast;
|
||||
public $images;
|
||||
public $video;
|
||||
|
||||
public $url;
|
||||
|
||||
public function __construct($data, $images = null) {
|
||||
public function __construct($data, $images = null, $podcast = null) {
|
||||
parent::__construct($data);
|
||||
parent::ConvertToDateTime($this->published);
|
||||
parent::ConvertToDateTime($this->edited);
|
||||
@@ -35,11 +35,21 @@ class NewsItem extends Model {
|
||||
}
|
||||
|
||||
$this->source = null;
|
||||
if(is_object($data->source))
|
||||
if(isset($data->source))
|
||||
{
|
||||
$this->source = new \Model\NewsSource($data->source->title, $data->source->url, $data->source->url);
|
||||
} else if($data->source) {
|
||||
$this->source = new \Model\NewsSource($data->source, $data->source_url, $data->showsource);
|
||||
if(is_object($data->source))
|
||||
{
|
||||
$this->source = new \Model\NewsSource($data->source->title, $data->source->url, $data->source->show);
|
||||
} else if($data->source) {
|
||||
$this->source = new \Model\NewsSource($data->source, $data->source_url, $data->showsource);
|
||||
}
|
||||
}
|
||||
|
||||
if($podcast)
|
||||
{
|
||||
$this->podcast = new \Model\Podcast($podcast);
|
||||
} else if(isset($data->podcast) && $data->podcast) {
|
||||
$this->podcast = new \Model\Podcast($data->podcast);
|
||||
}
|
||||
|
||||
$this->keywords = null;
|
||||
@@ -49,8 +59,6 @@ class NewsItem extends Model {
|
||||
$this->keywords = explode(' ', $data->keywords);
|
||||
}
|
||||
|
||||
$this->podcast = $data->podcast ? $data->podcast : null;
|
||||
|
||||
$images = ($images != null) ? $images
|
||||
: (isset($data->images) ? $data->images : null);
|
||||
if($images) {
|
||||
|
||||
Reference in New Issue
Block a user