_dbTable = $dbTable; return $this; } public function getDbTable() { if (null === $this->_dbTable) { $this->setDbTable('Application_Model_DbTable_BootIso'); } return $this->_dbTable; } public function save(Application_Model_BootIso $botiso) { $data = array('bootisoID'=> $botiso->getBootisoID() ,'membershipID'=> $botiso->getMembershipID() ,'groupID'=> $botiso->getGroupID() ,'serialnumber'=> $botiso->getSerialnumber() ,'created'=> $botiso->getCreated() ,'expires'=> $botiso->getExpires() ,'public'=> $botiso->getPublic() ); if (null === ($id = $botiso->getID()) ) { unset($data['botisoID']); $this->getDbTable()->insert($data); } else { $this->getDbTable()->update($data, array('botisoID = ?' => $id)); } } public function delete(Application_Model_BootIso $botiso) { if (null === ($id = $botiso->getID()) ) { return; } else { $this->getDbTable()->delete(array('botisoID = ?' => $id)); } } public function find($id, Application_Model_BootIso $botiso) { $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; } $row = $result->current(); $botiso->setBootisoID($row->bootisoID)->setMembershipID($row->membershipID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public); } public function fetchAll() { $resultSet = $this->getDbTable()->fetchAll(); $entries = array(); foreach ($resultSet as $row) { $entry = new Application_Model_BootIso(); $entry->setBootisoID($row->bootisoID)->setMembershipID($row->membershipID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public); $entries[] = $entry; } return $entries; } }