_dbTable = $dbTable; return $this; } public function getDbTable() { if (null === $this->_dbTable) { $this->setDbTable('Application_Model_DbTable_PoolEntries'); } return $this->_dbTable; } public function save(Application_Model_PoolEntries $polentries) { $data = array('poolID'=> $polentries->getPoolID() ,'clientID'=> $polentries->getClientID() ); if (null === ($id = $polentries->getID()) ) { unset($data['id']); $this->getDbTable()->insert($data); } else { $this->getDbTable()->update($data, array('id = ?' => $id)); } } public function find($id, Application_Model_PoolEntries $polentries) { $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; } $row = $result->current(); $polentries->setPoolID($row->poolID)->setClientID($row->clientID); } public function fetchAll() { $resultSet = $this->getDbTable()->fetchAll(); $entries = array(); foreach ($resultSet as $row) { $entry = new Application_Model_PoolEntries(); $entry->setPoolID($row->poolID)->setClientID($row->clientID); $entries[] = $entry; } return $entries; } }