Example #1
0
 public function getRatingForDefaultPlatform()
 {
     $platforms = $this->getPlatforms();
     if (sizeof($platforms) == 0) {
         return Rating::getRatingForScore(Rating::$NOT_APPLICABLE_SCORE);
     }
     $chosen_platform = $platforms[0];
     foreach ($platforms as $platform) {
         if ($platform->getName() == "windows") {
             $chosen_platform = $platform;
         }
     }
     $query = new RatingHeaderQuery();
     $query->filterByGame($this);
     $result = $query->findOneByPlatformId($chosen_platform->getId());
     return Rating::getRatingForScore($result->getScore());
 }