Esempio n. 1
0
 public static function getAllPlatforms()
 {
     return PlatformQuery::create()->find();
 }
Esempio n. 2
0
if (!Auth::checkIfAuthenticated() || !Auth::checkIfAdmin()) {
    header("Location: /");
    /* Redirect browser */
}
$user = Auth::getCurrentUser();
$game = null;
$platform = null;
$con = \Propel\Runtime\Propel::getConnection();
if (!array_key_exists("game", $_GET) || !array_key_exists("platform", $_GET)) {
    header("Location: /");
    /* Redirect browser */
    exit;
} else {
    $con->beginTransaction();
    $game = GameQuery::create()->filterByName($_GET["game"])->findOne($con);
    $platform = PlatformQuery::create()->filterByName($_GET["platform"])->findOne($con);
    if ($game == null || $platform == null) {
        header("Location: /");
        /* Redirect browser */
        exit;
    }
}
$header = RatingHeaderQuery::create()->filterByGame($game)->filterByPlatform($platform)->findOne($con);
$categories = CategoryQuery::create()->orderBySequence()->find($con);
$options = CategoryOptionQuery::create()->orderBySequence()->find($con);
if (array_key_exists("rating_submit", $_POST)) {
    try {
        if ($header == null) {
            $header = new RatingHeader();
            $header->setGame($game);
            $header->setPlatform($platform);