本文整理汇总了PHP中Movie::toMovies方法的典型用法代码示例。如果您正苦于以下问题:PHP Movie::toMovies方法的具体用法?PHP Movie::toMovies怎么用?PHP Movie::toMovies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movie
的用法示例。
在下文中一共展示了Movie::toMovies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MongoHQ
if ($fileName != null) {
$db = new MongoHQ(array('collectionName' => 'watched'));
$csv = new parseCSV($fileName);
$csv->auto();
$data = $csv->data;
//print_r($data);
if ($source == "imdb") {
$movies = IMDB::buildMovies($data);
var_dump(Movie::toMoviesDB($movies));
$db->saveMany(Movie::toMoviesDB($movies));
} else {
if ($source == "google") {
$hashMap = buildHash($data);
$db_movies = $db->find();
$mismatched = array();
foreach (Movie::toMovies($db_movies) as $movie) {
$title = $movie->TITLE;
//echo "<br/><div>[" . $$movie->POSITION . "] processing movie title: " . $title . " [db/rotten]</div>";
if (isset($hashMap[hkey($title)])) {
$rating = intval($hashMap[hkey($title)]['Rate']);
$movie->RATING = $rating;
//echo "<div>" . $movie->RATING . "</div>";
$db->save($movie->get());
} else {
$mismatched[] = $title;
}
}
foreach ($mismatched as $title) {
echo "<div>{$title}</div>";
}
}