@@ -13,7 +13,7 @@ class PodcastController extends Controller
|
||||
$viewData = [];
|
||||
if((int)$programma > 0) {
|
||||
$action = 'programma/' . (int)$programma;
|
||||
$viewData['program'] = new \Model\Program($this->API('programma/details/' . (int)$programma));
|
||||
$viewData['program'] = new \Model\Program((object) $this->API('programma/details/' . (int)$programma));
|
||||
}
|
||||
|
||||
return $this->getPodcastList($request, $action, $viewData);
|
||||
@@ -22,7 +22,7 @@ class PodcastController extends Controller
|
||||
private function getPodcastList(Request $request, $action, $viewData = [])
|
||||
{
|
||||
$page = (int)$request->get('pagina', 1);
|
||||
$apiResult = $this->API('podcast/' . $action . '?pagina=' . (int)max(1, $page) . '&aantal=8');
|
||||
$apiResult = (object) $this->API('podcast/' . $action . '?pagina=' . (int)max(1, $page) . '&aantal=8');
|
||||
$podcasts = [];
|
||||
foreach($apiResult->podcasts as $podcast)
|
||||
{
|
||||
@@ -35,15 +35,15 @@ class PodcastController extends Controller
|
||||
public function podcast(Request $request, $id)
|
||||
{
|
||||
parent::registerView($request, 'podcast', $id);
|
||||
$apiResult = $this->API('podcast/details/' . (int)$id);
|
||||
$podcast = new \Model\Podcast($apiResult);
|
||||
$apiResult = (object) $this->API('podcast/details/' . (int)$id);
|
||||
$podcast = new \Model\Podcast((object) $apiResult);
|
||||
$podcasts = [];
|
||||
if($podcast->program) {
|
||||
$apiResult = $this->API('podcast/programma/' . (int)$podcast->program->id . '?pagina=1&aantal=5');
|
||||
$apiResult = (object) $this->API('podcast/programma/' . (int)$podcast->program->id . '?pagina=1&aantal=5');
|
||||
$podcasts = [];
|
||||
foreach($apiResult->podcasts as $p)
|
||||
{
|
||||
$podcasts[] = new \Model\Podcast($p);
|
||||
$podcasts[] = new \Model\Podcast((object) $p);
|
||||
}
|
||||
}
|
||||
return view('podcastitem', ['podcast' => $podcast, 'metadata' => $podcast->metadata, 'podcasts' => $podcasts, 'isPodcast' => true]);
|
||||
|
||||
Reference in New Issue
Block a user