diff options
Diffstat (limited to 'application/models/RightMapper.php')
-rw-r--r-- | application/models/RightMapper.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/application/models/RightMapper.php b/application/models/RightMapper.php index 3ffe5f5..35e5b05 100644 --- a/application/models/RightMapper.php +++ b/application/models/RightMapper.php @@ -35,10 +35,19 @@ class Application_Model_RightMapper $data = array('rightID'=> $right->getID() ,'title'=> $right->getTitle() ,'description'=> $right->getDescription() ); if (null === ($id = $right->getID()) ) { - unset($data['id']); + unset($data['rightID']); $this->getDbTable()->insert($data); } else { - $this->getDbTable()->update($data, array('id = ?' => $id)); + $this->getDbTable()->update($data, array('rightID = ?' => $id)); + } + } + + public function delete(Application_Model_Right $right) + { + if (null === ($id = $right->getID()) ) { + return; + } else { + $this->getDbTable()->delete(array('rightID = ?' => $id)); } } |