Team.class: add drop function

This commit is contained in:
Li Chen 2013-11-30 15:43:53 +01:00
parent a6ecd0f432
commit c772fa61c2

View File

@ -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;
} }