public function displayById() { if (isset($_GET["jeu_id"])) { $idGame = $_GET["jeu_id"]; $idGame; $game = new T_E_JEUVIDEO_JEU($idGame); $photo = T_E_PHOTO_PHO::findByGame($idGame); $movie = T_E_VIDEO_VID::findByGame($idGame); $advice = T_E_AVIS_AVI::findByGame($idGame); $this->render('displayById', array($game, $photo, $movie, $advice)); } else { $this->render("find"); } }
public static function findBySelection($id_console) { $class = get_called_class(); $table = strtolower($class); $idtable = substr($table, -3) . "_id"; $list = array(); foreach (T_E_JEUVIDEO_JEU::findAll() as $row) { if ($row->T_R_CONSOLE_CON->con_id == $id_console) { $game = new T_E_JEUVIDEO_JEU($row->jeu_id); foreach (T_E_PHOTO_PHO::findByGame($row->jeu_id) as $key => $value) { $game->photo = $value->pho_url; break; } $list[] = $game; } } return $list; }
public function findGameByRay($id, $name) { if ($id == 'tous') { $st = db()->prepare("select * from t_e_jeuvideo_jeu where lower(jeu_nom) like lower(:name)"); } else { $st = db()->prepare("select * from t_e_jeuvideo_jeu where jeu_id in (select jeu_id from t_j_jeurayon_jer where ray_id=:rayid) and lower(jeu_nom) like lower(:name)"); $st->bindValue(":rayid", $id); } $st->bindValue(":name", "%{$name}%"); $st->execute(); $games = array(); if ($st->rowCount() >= 1) { while ($row = $st->fetch(PDO::FETCH_ASSOC)) { $game = new T_E_JEUVIDEO_JEU($row['jeu_id']); foreach (T_E_PHOTO_PHO::findByGame($row['jeu_id']) as $key => $value) { $game->photo = $value->pho_url; break; } $games[] = $game; } } return $games; }