diff options
Diffstat (limited to 'application/models/GroupRequestMapper.php')
-rw-r--r-- | application/models/GroupRequestMapper.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/application/models/GroupRequestMapper.php b/application/models/GroupRequestMapper.php index 8ffd88e..c09e047 100644 --- a/application/models/GroupRequestMapper.php +++ b/application/models/GroupRequestMapper.php @@ -35,10 +35,19 @@ class Application_Model_GroupRequestMapper $data = array('grouprequestID'=> $grouprequest->getID() ,'groupID'=> $grouprequest->getGroupID() ,'personID'=> $grouprequest->getPersonID() ,'time'=> $grouprequest->getTime() ); if (null === ($id = $grouprequest->getID()) ) { - unset($data['id']); + unset($data['grouprequestID']); $this->getDbTable()->insert($data); } else { - $this->getDbTable()->update($data, array('id = ?' => $id)); + $this->getDbTable()->update($data, array('grouprequestID = ?' => $id)); + } + } + + public function delete(Application_Model_GroupRequest $grouprequest) + { + if (null === ($id = $grouprequest->getID()) ) { + return; + } else { + $this->getDbTable()->delete(array('grouprequestID = ?' => $id)); } } |