diff options
Diffstat (limited to 'application/models/PoolMapper.php')
| -rw-r--r-- | application/models/PoolMapper.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/application/models/PoolMapper.php b/application/models/PoolMapper.php index f889330..f9be34f 100644 --- a/application/models/PoolMapper.php +++ b/application/models/PoolMapper.php @@ -35,10 +35,19 @@ class Application_Model_PoolMapper $data = array('poolID'=> $pol->getPoolID() ,'title'=> $pol->getTitle() ,'description'=> $pol->getDescription() ,'location'=> $pol->getLocation() ); if (null === ($id = $pol->getID()) ) { - unset($data['id']); + unset($data['polID']); $this->getDbTable()->insert($data); } else { - $this->getDbTable()->update($data, array('id = ?' => $id)); + $this->getDbTable()->update($data, array('polID = ?' => $id)); + } + } + + public function delete(Application_Model_Pool $pol) + { + if (null === ($id = $pol->getID()) ) { + return; + } else { + $this->getDbTable()->delete(array('polID = ?' => $id)); } } |
