From c772fa61c2480bd630a5de9e35bb027e949239d2 Mon Sep 17 00:00:00 2001 From: Li Chen Date: Sat, 30 Nov 2013 15:43:53 +0100 Subject: [PATCH] Team.class: add drop function --- onyx/include/common/Team.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/onyx/include/common/Team.class.php b/onyx/include/common/Team.class.php index 0e3c9ffe..18e615c6 100644 --- a/onyx/include/common/Team.class.php +++ b/onyx/include/common/Team.class.php @@ -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; }