function iso3166() { \model\simple\Iso31::getIso3166(); }
static function getIso3166($lang = "fr") { $a = new Iso31(); return $a->iso3166($lang); }
function getMovieFormat($id, $lang = "fr") { $pays = Iso31::getIso3166($lang); $t = null; $setting = $this->getCloud(); $response = $this->getMovie($id, $lang); $t["code"] = $id; if (isset($response->original_title)) { $t["Titre Original"] = $response->original_title; } if (isset($response->title)) { $t["Titre"] = $response->title; } if (isset($response->runtime)) { $t["Durée"] = $this->dateFormat($response->runtime); } if (isset($response->release_date)) { $t["Date de sortie"] = preg_replace("#(\\d+)\\-(\\d+)\\-(\\d+)#", "\$3/\$2/\$1", $response->release_date); } if (isset($response->production_companies)) { $res = ""; foreach ($response->production_companies as $k => $v) { $res .= ", " . $v->name; } $t["Distributeur"] = substr($res, 2); } if (isset($response->casts->crew)) { $res = ""; for ($i = 0; $i < count($response->casts->crew); $i++) { if ($response->casts->crew[$i]->job == "Director") { $res .= ", " . $response->casts->crew[$i]->name; } } $t["Réalisateur"] = substr($res, 2); } if (isset($response->casts->cast)) { $max = 5; if (count($response->casts->cast) < 5) { $max = count($response->casts->cast); } $res = ""; for ($i = 0; $i < $max; $i++) { $res .= ", " . $response->casts->cast[$i]->name; } $t["Acteur(s)"] = substr($res, 2); } if (isset($response->poster_path)) { $t["poster"] = $setting->images->secure_base_url . 'original' . $response->poster_path; } if (isset($response->production_countries)) { $res = ""; foreach ($response->production_countries as $k => $v) { $res .= ", " . $pays[$v->iso_3166_1]; } $t["Origine"] = substr($res, 2); } if (isset($response->genres)) { $res = null; foreach ($response->genres as $k => $v) { $res[] = $v->name; } $t["Genre"] = $res; } if (isset($response->overview)) { $t["Synopsis"] = $response->overview; } if (isset($response->backdrop_path)) { $t["fond"] = $setting->images->secure_base_url . "original" . $response->backdrop_path; } return $t; }