summaryrefslogtreecommitdiffstats
path: root/application/models/PoolFiltersMapper.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/models/PoolFiltersMapper.php')
-rw-r--r--application/models/PoolFiltersMapper.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/application/models/PoolFiltersMapper.php b/application/models/PoolFiltersMapper.php
index 88ffe97..582f955 100644
--- a/application/models/PoolFiltersMapper.php
+++ b/application/models/PoolFiltersMapper.php
@@ -35,10 +35,19 @@ class Application_Model_PoolFiltersMapper
$data = array('poolID'=> $polfilters->getPoolID() ,'filterID'=> $polfilters->getFilterID() );
if (null === ($id = $polfilters->getID()) ) {
- unset($data['id']);
+ unset($data['polfiltersID']);
$this->getDbTable()->insert($data);
} else {
- $this->getDbTable()->update($data, array('id = ?' => $id));
+ $this->getDbTable()->update($data, array('polfiltersID = ?' => $id));
+ }
+ }
+
+ public function delete(Application_Model_PoolFilters $polfilters)
+ {
+ if (null === ($id = $polfilters->getID()) ) {
+ return;
+ } else {
+ $this->getDbTable()->delete(array('polfiltersID = ?' => $id));
}
}