summaryrefslogtreecommitdiffstats
path: root/application/models/RightRolesMapper.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/models/RightRolesMapper.php')
-rw-r--r--application/models/RightRolesMapper.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/application/models/RightRolesMapper.php b/application/models/RightRolesMapper.php
index afd5c26..ae409d8 100644
--- a/application/models/RightRolesMapper.php
+++ b/application/models/RightRolesMapper.php
@@ -35,10 +35,19 @@ class Application_Model_RightRolesMapper
$data = array('roleID'=> $rightroles->getRoleID() ,'rightID'=> $rightroles->getRightID() );
if (null === ($id = $rightroles->getID()) ) {
- unset($data['id']);
+ unset($data['rightrolesID']);
$this->getDbTable()->insert($data);
} else {
- $this->getDbTable()->update($data, array('id = ?' => $id));
+ $this->getDbTable()->update($data, array('rightrolesID = ?' => $id));
+ }
+ }
+
+ public function delete(Application_Model_RightRoles $rightroles)
+ {
+ if (null === ($id = $rightroles->getID()) ) {
+ return;
+ } else {
+ $this->getDbTable()->delete(array('rightrolesID = ?' => $id));
}
}