diff options
author | michael pereira | 2011-03-04 03:10:53 +0100 |
---|---|---|
committer | michael pereira | 2011-03-04 03:10:53 +0100 |
commit | cd5f39054796ffe8cdda493d472d302a4de9e768 (patch) | |
tree | 517ee81c31809317e36bfd1141dfdb952e021d89 /application/models/PoolEntriesMapper.php | |
parent | fixing git (diff) | |
download | pbs2-cd5f39054796ffe8cdda493d472d302a4de9e768.tar.gz pbs2-cd5f39054796ffe8cdda493d472d302a4de9e768.tar.xz pbs2-cd5f39054796ffe8cdda493d472d302a4de9e768.zip |
Mapper mit neuer delete function
Diffstat (limited to 'application/models/PoolEntriesMapper.php')
-rw-r--r-- | application/models/PoolEntriesMapper.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/application/models/PoolEntriesMapper.php b/application/models/PoolEntriesMapper.php index 77bd34c..5d92f4c 100644 --- a/application/models/PoolEntriesMapper.php +++ b/application/models/PoolEntriesMapper.php @@ -35,10 +35,19 @@ class Application_Model_PoolEntriesMapper $data = array('poolID'=> $polentries->getPoolID() ,'clientID'=> $polentries->getClientID() ); if (null === ($id = $polentries->getID()) ) { - unset($data['id']); + unset($data['polentriesID']); $this->getDbTable()->insert($data); } else { - $this->getDbTable()->update($data, array('id = ?' => $id)); + $this->getDbTable()->update($data, array('polentriesID = ?' => $id)); + } + } + + public function delete(Application_Model_PoolEntries $polentries) + { + if (null === ($id = $polentries->getID()) ) { + return; + } else { + $this->getDbTable()->delete(array('polentriesID = ?' => $id)); } } |