summaryrefslogtreecommitdiffstats
path: root/application/models/GroupMapper.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/models/GroupMapper.php')
-rw-r--r--application/models/GroupMapper.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/application/models/GroupMapper.php b/application/models/GroupMapper.php
index 5ad6c64..b9c7e30 100644
--- a/application/models/GroupMapper.php
+++ b/application/models/GroupMapper.php
@@ -35,10 +35,19 @@ class Application_Model_GroupMapper
$data = array('groupID'=> $group->getID() ,'title'=> $group->getTitle() ,'description'=> $group->getDescription() );
if (null === ($id = $group->getID()) ) {
- unset($data['id']);
+ unset($data['groupID']);
$this->getDbTable()->insert($data);
} else {
- $this->getDbTable()->update($data, array('id = ?' => $id));
+ $this->getDbTable()->update($data, array('groupID = ?' => $id));
+ }
+ }
+
+ public function delete(Application_Model_Group $group)
+ {
+ if (null === ($id = $group->getID()) ) {
+ return;
+ } else {
+ $this->getDbTable()->delete(array('groupID = ?' => $id));
}
}