Fixed program schedule generation algorithm
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user