diff options
| author | Simon | 2011-03-06 20:12:10 +0100 |
|---|---|---|
| committer | Simon | 2011-03-06 20:12:10 +0100 |
| commit | bfea08336f782e0e796b15dc7a1b4af4b1e3783a (patch) | |
| tree | e752570b47d3a8604940f0bda58494625c3eaa5f /application/models/PoolMapper.php | |
| parent | clients hinzufügen und entfernen && sql-data erweitert (diff) | |
| download | pbs2-bfea08336f782e0e796b15dc7a1b4af4b1e3783a.tar.gz pbs2-bfea08336f782e0e796b15dc7a1b4af4b1e3783a.tar.xz pbs2-bfea08336f782e0e796b15dc7a1b4af4b1e3783a.zip | |
Pool add, edit und remove hinzugefügt
Diffstat (limited to 'application/models/PoolMapper.php')
| -rw-r--r-- | application/models/PoolMapper.php | 15 |
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; } |
