make add/remove starter buttons date sensitive
This commit is contained in:
@@ -57,7 +57,20 @@ class Shiai
|
||||
return ($this->place != null ? $this->place : '-');
|
||||
}
|
||||
|
||||
public static function fromArray($member)
|
||||
public static function loadFromDb(int $id)
|
||||
{
|
||||
$query = 'SELECT * FROM `cwsvjudo`.`wettkampfkalender` WHERE `lfdeNr` = :id;';
|
||||
$params = [':id' => ['value' => $id, 'data_type' => PDO::PARAM_INT]];
|
||||
$response = dbConnector::query($query, $params);
|
||||
|
||||
// ids are considered unique. so every other count then 1 is treated as error to prevent unprivileged access
|
||||
if (count($response) != 1) {
|
||||
return null;
|
||||
}
|
||||
return self::fromDbArray($response[0]);
|
||||
}
|
||||
|
||||
public static function fromDbArray($member)
|
||||
{
|
||||
return new shiai(
|
||||
$member['lfdeNr'] ?? null,
|
||||
|
||||
Reference in New Issue
Block a user