Fix bug with podcasts incorrectly linked to program

This commit is contained in:
2017-09-23 13:22:24 +02:00
parent df43c67836
commit cb783ec4e8

View File

@@ -25,11 +25,12 @@ class Podcast extends Model {
$this->auth = $this->key;
}
if(isset($data->program) && $data->program) {
if(isset($data->program)) {
$this->program = null;
if(is_object($data->program)) {
$this->program = new \Model\Program($data->program);
} else {
$this->program = new \Model\Program(['id' => $this->program, 'name' => $data->program_name, 'description' => $data->program_description]);
} elseif($data->program) {
$this->program = new \Model\Program(['id' => $data->program, 'name' => $data->program_name, 'description' => $data->program_description]);
}
}
}