From cd5f39054796ffe8cdda493d472d302a4de9e768 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Fri, 4 Mar 2011 03:10:53 +0100 Subject: Mapper mit neuer delete function --- application/models/GroupGroupsMapper.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'application/models/GroupGroupsMapper.php') diff --git a/application/models/GroupGroupsMapper.php b/application/models/GroupGroupsMapper.php index dce6a5a..79bf774 100644 --- a/application/models/GroupGroupsMapper.php +++ b/application/models/GroupGroupsMapper.php @@ -35,10 +35,19 @@ class Application_Model_GroupGroupsMapper $data = array('parentID'=> $groupgroups->getParentID() ,'groupID'=> $groupgroups->getGroupID() ); if (null === ($id = $groupgroups->getID()) ) { - unset($data['id']); + unset($data['groupgroupsID']); $this->getDbTable()->insert($data); } else { - $this->getDbTable()->update($data, array('id = ?' => $id)); + $this->getDbTable()->update($data, array('groupgroupsID = ?' => $id)); + } + } + + public function delete(Application_Model_GroupGroups $groupgroups) + { + if (null === ($id = $groupgroups->getID()) ) { + return; + } else { + $this->getDbTable()->delete(array('groupgroupsID = ?' => $id)); } } -- cgit v1.2.3-55-g7522