tippspiel2027/src/Models/Round.php

29 lines
664 B
PHP
Raw Normal View History

2026-10-03 16:27:22 +02:00
<?php
namespace App\Models;
use App\Core\Database;
class Round {
/**
* Holt eine Runde anhand der ID
*/
public static function getById($id) {
$db = Database::getConnection();
$stmt = $db->prepare("SELECT * FROM rounds WHERE id = ?");
$stmt->execute([$id]);
return $stmt->fetch();
}
/**
* Holt alle Runden einer Season
*/
public static function getBySeason($seasonId) {
$db = Database::getConnection();
$stmt = $db->prepare("SELECT * FROM rounds WHERE season_id = ? ORDER BY id ASC");
$stmt->execute([$seasonId]);
return $stmt->fetchAll();
}
}