예제 #1
0
 public static function getUserReview(Games $game, Platforms $platform, User $user)
 {
     $query = new UserReviewsQuery();
     $query->filterByGames($game);
     $query->filterByPlatforms($platform);
     $query->filterByUser($user);
     $result = $query->findOne();
     return $result;
 }
예제 #2
0
파일: game.php 프로젝트: nirkbirk/site
?>
				</table>
			</div>
			<div class="col-md-8">
                <?php 
echo '<img src="' . $game->getGbImage() . '" style="height:200px;" />';
?>
				<p><?php 
echo $game->getDescription();
?>
</p>
			<br/>	
			<table class="table">
				<th style="width: 25px">*</th><th style="width:100%;">User reviews</th><th style="white-space:nowrap;">Review by</th>
                <?php 
$query = new UserReviewsQuery();
$query->filterByPlatforms($platform);
$reviews = $query->findByGameId($game->getId());
if ($reviews->count() == 0) {
    echo '<tr><td></td><td>No reviews submitted for this platform...</td><td></td></tr>';
}
foreach ($reviews as $review) {
    $rating = $review->getRatings();
    if ($rating == null) {
        exit;
    }
    $review_user = $review->getUser();
    echo '<tr><td>';
    echo '<img src="img/badges/' . $rating->getInitial() . '_tiny.jpg" alt="' . $rating->getTitle() . '" height="20"></td>';
    echo '<td >' . $review->getReview() . '</td>';
    echo '<td><a href="https://www.reddit.com/user/' . $review_user->getUsername() . '/">/u/' . $review_user->getUsername() . '</a></td></tr>';