mirror of
https://github.com/appen-isen/site-interpromos.git
synced 2026-03-18 21:40:36 +01:00
fix team deletion issue on match listing
This commit is contained in:
@@ -406,6 +406,22 @@ class Database
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a team
|
||||
*/
|
||||
public function deleteTeam(int $id): bool {
|
||||
$success = true;
|
||||
|
||||
$request = 'DELETE from teams where id = :id';
|
||||
|
||||
$statement = $this->PDO->prepare($request);
|
||||
$statement->bindParam(':id', $id);
|
||||
|
||||
$success = $statement->execute() && $success;
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all teams in the db
|
||||
*
|
||||
@@ -423,7 +439,10 @@ class Database
|
||||
/**
|
||||
* Gets the team name according to the id
|
||||
*/
|
||||
public function getTeamName(int $id): ?string {
|
||||
public function getTeamName(?int $id): ?string {
|
||||
if ($id == null) {
|
||||
return null;
|
||||
}
|
||||
$request = 'SELECT name from teams where id = :id';
|
||||
|
||||
$statement = $this->PDO->prepare($request);
|
||||
|
||||
Reference in New Issue
Block a user