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