summaryrefslogtreecommitdiffstats
path: root/application/models
diff options
context:
space:
mode:
Diffstat (limited to 'application/models')
-rw-r--r--application/models/PoolMapper.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/application/models/PoolMapper.php b/application/models/PoolMapper.php
index f9be34f..e2d351a 100644
--- a/application/models/PoolMapper.php
+++ b/application/models/PoolMapper.php
@@ -32,13 +32,16 @@ class Application_Model_PoolMapper
public function save(Application_Model_Pool $pol)
{
- $data = array('poolID'=> $pol->getPoolID() ,'title'=> $pol->getTitle() ,'description'=> $pol->getDescription() ,'location'=> $pol->getLocation() );
+ $data = array('poolID'=> $pol->getID() ,
+ 'title'=> $pol->getTitle() ,
+ 'description'=> $pol->getDescription() ,
+ 'location'=> $pol->getLocation() );
if (null === ($id = $pol->getID()) ) {
- unset($data['polID']);
+ unset($data['poolID']);
$this->getDbTable()->insert($data);
} else {
- $this->getDbTable()->update($data, array('polID = ?' => $id));
+ $this->getDbTable()->update($data, array('poolID = ?' => $id));
}
}
@@ -47,7 +50,7 @@ class Application_Model_PoolMapper
if (null === ($id = $pol->getID()) ) {
return;
} else {
- $this->getDbTable()->delete(array('polID = ?' => $id));
+ $this->getDbTable()->delete(array('poolID = ?' => $id));
}
}
@@ -60,7 +63,7 @@ class Application_Model_PoolMapper
$row = $result->current();
- $pol->setPoolID($row->poolID)->setTitle($row->title)->setDescription($row->description)->setLocation($row->location);
+ $pol->setID($row->poolID)->setTitle($row->title)->setDescription($row->description)->setLocation($row->location);
}
public function fetchAll()
@@ -70,7 +73,7 @@ class Application_Model_PoolMapper
foreach ($resultSet as $row) {
$entry = new Application_Model_Pool();
- $entry->setPoolID($row->poolID)->setTitle($row->title)->setDescription($row->description)->setLocation($row->location);
+ $entry->setID($row->poolID)->setTitle($row->title)->setDescription($row->description)->setLocation($row->location);
$entries[] = $entry;
}