Plaatje toegevoegd aan podcast

This commit is contained in:
2019-10-22 21:37:39 +02:00
parent 2b5e21f481
commit d27de22d48
2 changed files with 12 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ class PodcastController extends Controller
public static $BASE_SQL = <<<QUERY
SELECT `podcast`.`id`, `podcast`.`soundfilename`,
`podcast_meta`.`creationdt` AS `created`, `podcast_meta`.`title`, `podcast_meta`.`content`, `podcast_meta`.`program`,
`podcast_meta`.`imagefile`, `podcast_meta`.`imagecaption`,
`programs`.`longname` AS `program_name`, `programs`.`description` AS `program_description`
FROM `podcast`
INNER JOIN `podcast_meta` ON `podcast`.`id` = `podcast_meta`.`podcast`

View File

@@ -2,6 +2,8 @@
namespace Model;
require "NewsImage.php";
class Podcast extends Model {
public $id;
public $title;
@@ -12,6 +14,7 @@ class Podcast extends Model {
public $url;
public $auth;
public $download;
public $image;
private $key;
public function __construct($data) {
@@ -33,6 +36,14 @@ class Podcast extends Model {
$this->program = new \Model\Program(['id' => $data->program, 'name' => $data->program_name, 'description' => $data->program_description]);
}
}
if(isset($data->imagefile)) {
$imagedata = new \stdClass();
$imagedata->id = $this->id;
$imagedata->file = $data->imagefile;
$imagedata->title = $data->imagecaption;
$this->image = new NewsImage($imagedata, '/img/podcast/');
}
}
public function titleWithoutProgram() {