29 lines
664 B
PHP
29 lines
664 B
PHP
|
|
<?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();
|
||
|
|
}
|
||
|
|
}
|