findOne(['slug' => $slug]); if ($b === null) { throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound(); } $games = []; foreach ($b['games'] as $gslug) { $g = (new GameModel())->findBySlug($gslug); if ($g !== null) { $games[] = $g; } } $data = [ 'pageTitle' => $b['title'] . ' Bundle — GG.deals', 'bundle' => $b, 'games' => $games, 'stores' => (new StoreModel())->map(), ]; return view('bundle', $data); } }