...
This commit is contained in:
parent
366935846c
commit
4bf3bbb978
8 changed files with 348 additions and 2 deletions
28
src/Models/Round.php
Normal file
28
src/Models/Round.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue