示例#1
0
 /**
  * Get the associated ChildPlatforms object
  *
  * @param  ConnectionInterface $con Optional Connection object.
  * @return ChildPlatforms The associated ChildPlatforms object.
  * @throws PropelException
  */
 public function getPlatforms(ConnectionInterface $con = null)
 {
     if ($this->aPlatforms === null && ($this->platform_id !== "" && $this->platform_id !== null)) {
         $this->aPlatforms = ChildPlatformsQuery::create()->findPk($this->platform_id, $con);
         /* The following can be used additionally to
               guarantee the related object contains a reference
               to this object.  This level of coupling may, however, be
               undesirable since it could result in an only partially populated collection
               in the referenced object.
               $this->aPlatforms->addUserReviewss($this);
            */
     }
     return $this->aPlatforms;
 }
示例#2
0
文件: game.php 项目: nirkbirk/site
    exit;
} else {
    $query = new GamesQuery();
    $game = $query->findOneByName($_GET["name"]);
    if ($game == null) {
        header("Location: /");
        /* Redirect browser */
        exit;
    }
}
if (!array_key_exists("platform", $_GET)) {
    $platform = "windows";
} else {
    $platform = $_GET["platform"];
}
$query = new PlatformsQuery();
$platform = $query->findOneByName($platform);
if ($platform == null) {
    throw new Exception("Invalid platform specified");
}
// Getting the rating queries the database each time, so we do it once here:
$header = $game->getRatingHeaderForPlatform($platform);
$rating = $game->getRatingForPlatform($platform);
$user = Auth::getCurrentUser();
if (Auth::checkIfAuthenticated() && array_key_exists("submit_game_review", $_POST) && array_key_exists("submit_game_rating", $_POST)) {
    $new_review = $_POST["submit_game_review"];
    $new_rating = $_POST["submit_game_rating"];
    $review = UserReviews::getUserReview($game, $platform, $user);
    if ($review == null) {
        $review = new UserReviews();
        $review->setGames($game);
示例#3
0
require "res/include.php";
if (!Auth::checkIfAdmin()) {
    header("Location: /");
    /* Redirect browser */
}
$user = Auth::getCurrentUser();
$game = null;
$platform = null;
if (!array_key_exists("game", $_GET) || !array_key_exists("platform", $_GET)) {
    header("Location: /");
    /* Redirect browser */
    exit;
} else {
    $query = new GamesQuery();
    $game = $query->findOneByName($_GET["game"]);
    $query = new PlatformsQuery();
    $platform = $query->findOneByName($_GET["platform"]);
    if ($game == null || $platform == null) {
        header("Location: /");
        /* Redirect browser */
        exit;
    }
}
$header = RatingHeadersQuery::create()->filterByGames($game)->filterByPlatforms($platform)->findOne();
if (array_key_exists("category_options_1", $_POST)) {
    $con = \Propel\Runtime\Propel::getConnection();
    $con->beginTransaction();
    try {
        if (!Auth::checkIfAuthenticated()) {
            throw new Exception("User not authenticated");
        }
示例#4
0
 /**
  * Builds a Criteria object containing the primary key for this object.
  *
  * Unlike buildCriteria() this method includes the primary key values regardless
  * of whether or not they have been modified.
  *
  * @throws LogicException if no primary key is defined
  *
  * @return Criteria The Criteria object containing value(s) for primary key(s).
  */
 public function buildPkeyCriteria()
 {
     $criteria = ChildPlatformsQuery::create();
     $criteria->add(PlatformsTableMap::COL_ID, $this->id);
     return $criteria;
 }