Team.class: add drop function
This commit is contained in:
parent
a6ecd0f432
commit
c772fa61c2
@ -89,6 +89,19 @@ class Team
|
||||
return ($aff == 1);
|
||||
}
|
||||
|
||||
// TODO: Drop members ?
|
||||
function drop()
|
||||
{
|
||||
$db = new BDD();
|
||||
if (!empty($this->id))
|
||||
$db->query("DELETE FROM teams WHERE id = ".intval($this->id));
|
||||
$aff = $db->affected();
|
||||
if ($aff == 1)
|
||||
$this->id = 0;
|
||||
$db->deconnexion();
|
||||
return $aff;
|
||||
}
|
||||
|
||||
function get_id() {
|
||||
return $this->id;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user