Fixed program schedule generation algorithm

This commit is contained in:
2017-08-01 02:03:12 +02:00
parent b3a3e4e5da
commit 3ad71819a4
3 changed files with 161 additions and 183 deletions

View File

@@ -9,12 +9,16 @@ class Program extends Model {
public $email;
public $priority;
// TODO: Implementeren
public $hosts;
public $schedule;
public function __construct($data) {
parent::__construct($data);
if(isset($data->suffix) && $data->suffix) {
$this->name .= ' ' . $data->suffix;
}
if($this->schedule && $this->schedule->next && $this->schedule->next->time) {
parent::ConvertToDateTime($this->schedule->next->time);
}
@@ -31,4 +35,8 @@ class Program extends Model {
$this->url = "/{$this->id}/" . parent::url_slug($this->name);
}
public function isSpecial() {
return ($this->priority < 2);
}
}