summaryrefslogtreecommitdiffstats
path: root/createDefaultMapper
diff options
context:
space:
mode:
authormichael pereira2011-03-04 03:21:32 +0100
committermichael pereira2011-03-04 03:21:32 +0100
commite2db1dc442e9f28fe666537a8af024c810912bb4 (patch)
treede16d36dff50a950dd963788689e18576a6db02f /createDefaultMapper
parentInserted deleteForm (diff)
parentÄnderungen an den Filtern (diff)
downloadpbs2-e2db1dc442e9f28fe666537a8af024c810912bb4.tar.gz
pbs2-e2db1dc442e9f28fe666537a8af024c810912bb4.tar.xz
pbs2-e2db1dc442e9f28fe666537a8af024c810912bb4.zip
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Conflicts: .zfproject.xml
Diffstat (limited to 'createDefaultMapper')
-rw-r--r--createDefaultMapper/mappertemplate13
1 files changed, 11 insertions, 2 deletions
diff --git a/createDefaultMapper/mappertemplate b/createDefaultMapper/mappertemplate
index 62de1eb..c7c857e 100644
--- a/createDefaultMapper/mappertemplate
+++ b/createDefaultMapper/mappertemplate
@@ -35,10 +35,19 @@ class Application_Model_MAPPER
$data = array(SAVEDATA);
if (null === ($id = $MVAR->getID()) ) {
- unset($data['id']);
+ unset($data['MVARID']);
$this->getDbTable()->insert($data);
} else {
- $this->getDbTable()->update($data, array('id = ?' => $id));
+ $this->getDbTable()->update($data, array('MVARID = ?' => $id));
+ }
+ }
+
+ public function delete(Application_Model_MODEL $MVAR)
+ {
+ if (null === ($id = $MVAR->getID()) ) {
+ return;
+ } else {
+ $this->getDbTable()->delete(array('MVARID = ?' => $id));
}
}