本文整理汇总了PHP中Movie::_getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Movie::_getList方法的具体用法?PHP Movie::_getList怎么用?PHP Movie::_getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movie
的用法示例。
在下文中一共展示了Movie::_getList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array_keys
" role="button">Voir la fiche du film »</a></p>
</div>
</div>
<!-- END BLOCK RANDOM MOVIE -->
<?php
}
?>
</div><!-- .marketing -->
<?php
if (!empty($_SESSION['movies'])) {
$movie_ids_array = array_keys($_SESSION['movies']);
$movie_ids = implode(', ', $movie_ids_array);
$movie_ids_order = 'ORDER BY id = ' . implode(' DESC, id = ', $movie_ids_array) . ' DESC';
$visited_movies = Movie::_getList($db->query('SELECT * FROM movies WHERE id IN (' . $movie_ids . ') ' . $movie_ids_order)->fetchAll());
/*
$result = $db->query('SELECT * FROM movies WHERE id IN ('.$movie_ids.')')->fetchAll();
$visited_movies = $_SESSION['movies'];
foreach($result as $key => $movie) {
$visited_movies[$movie->id] = $movie;
}
*/
?>
<hr>
<h1>Les derniers films visités</h1>
<div id="visited-movies" class="row">
<?php
示例2:
<?php
$top_rating_movies = Movie::getList(5, 'rating DESC', 'id, title');
$most_recent_movies = Movie::getList(5, 'year DESC', 'id, title');
$random_movies = Movie::getList(5, 'RAND()', 'id, title');
$last_news = Movie::_getList($db->query('SELECT news_id as id, news_title as title FROM news ORDER BY news_date DESC LIMIT 5')->fetchAll());
?>
<!-- SIDEBAR -->
<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
<?php
echo Utils::displayList($top_rating_movies, 'Les 5 films les mieux notés', 'movie.php', 'primary');
echo Utils::displayList($most_recent_movies, 'Les 5 films les plus récents', 'movie.php', 'info');
echo Utils::displayList($random_movies, '5 films au hasard', 'movie.php', 'warning');
echo Utils::displayList($last_news, 'Les dernières actualités', 'article.php');
?>
</div>
<!-- END SIDEBAR -->