public function executeSave(sfWebRequest $request) { ini_set('display_errors', false); $util = new Util(); $tvshow_info = $util->initTVShowInfoArray(); $tvshow_info = $request->getPostParameter("data"); $util->updateTVShowFromForm($tvshow_info); exit; }
/** * Gets tvshow data from imdb. * Used in /tvshow/actions/imdbSuccess * * @param IMDb Object $result * @return String ex: [Star Wars, George Lucas, [Action, Sci-Fi], USA, 2009] */ public static function getTVShowInfoFromImdb($result) { $tvshow_info = Util::initTVShowInfoArray(); $tvshow_info['org_title'] = $result->title(); foreach ($result->creator() as $director) { $tvshow_info['directors'][] = $result['main_creator']; // $person = new imdb_person($director['imdb']); // $person->savephoto("D:\Nass\homecenter", false); } $tvshow_info['year'] = $result->year(); foreach ($result->genres() as $genre) { $tvshow_info['genres'][] = $genre; } $count = 1; foreach ($result->cast() as $actor) { $pos = strrpos($actor['role'], "/ ..."); if ($pos == 0) { $pos = strrpos($actor['role'], "("); } $item = array(); $item['photo'] = $actor['photo']; $item['actor'] = $actor['name']; $item['character'] = substr($actor['role'], 0, $pos - 1); $tvshow_info['actors'][] = $item; $count++; if ($count > 40) { break; } } foreach ($result->country() as $country) { $tvshow_info['countries'][] = $country; } $plot = $result->plot(); $tvshow_info['plot'] = $plot[0]; return $tvshow_info; }