Team.class: add drop function
This commit is contained in:
parent
a6ecd0f432
commit
c772fa61c2
1 changed files with 13 additions and 0 deletions
|
@ -89,6 +89,19 @@ class Team
|
||||||
return ($aff == 1);
|
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() {
|
function get_id() {
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue