Plaatje toegevoegd aan podcast
This commit is contained in:
@@ -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`
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user