Calendar added

This commit is contained in:
2017-08-02 23:58:49 +02:00
parent 9201c50812
commit 4f3490367f
6 changed files with 70 additions and 148 deletions

View File

@@ -10,13 +10,26 @@ class CalendarEvent extends Model {
public $starts;
public $ends;
public $images;
public $podcast;
public $keywords;
public $url;
public function __construct($data, $images = null) {
parent::__construct($data);
parent::ConvertToDateTime($this->starts);
parent::ConvertToDateTime($this->ends);
$this->keywords = null;
if(isset($data->keywords)) {
if(is_array($data->keywords)) {
$this->keywords = $data->keywords;
} else if(trim($data->keywords)) {
$this->keywords = explode(' ', $data->keywords);
}
}
$this->podcast = isset($data->podcast) && $data->podcast ? $data->podcast : null;
$images = ($images != null) ? $images
: (isset($data->images) ? $data->images : null);
if($images) {