Test version

This commit is contained in:
Jorit Tijsen
2024-03-05 17:22:55 +01:00
parent 8acacc0c68
commit 55aa88c0f6
128 changed files with 46700 additions and 9645 deletions

View File

@@ -0,0 +1,54 @@
<?php
namespace Model;
class Program extends Model {
public $id;
public $name;
public $tagline;
public $description;
public $email;
public $nonstop;
public $rerun;
public $priority;
public $hosts;
public $recent;
public $next;
public function __construct($data) {
parent::__construct($data);
if(isset($data->suffix) && $data->suffix) {
$this->name .= ' ' . $data->suffix;
}
if($this->recent && $this->recent) {
foreach($this->recent as &$recent) {
parent::ConvertToDateTime($recent->starts);
parent::ConvertToDateTime($recent->ends);
}
}
if($this->next && $this->next) {
foreach($this->next as &$next) {
parent::ConvertToDateTime($next->starts);
parent::ConvertToDateTime($next->ends);
}
}
if(isset($data->email) && ($mailComma = strpos($data->email, ',')) !== false) {
$this->email = substr($data->email, 0, $mailComma);
}
if(isset($data->state)) {
$this->nonstop = $data->state == 0;
$this->rerun = $data->state == 3;
}
$this->url = "/{$this->id}/" . parent::url_slug($this->name);
}
public function isSpecial() {
return ($this->priority < 2);
}
}