_dbTable = $dbTable; return $this; } public function getDbTable() { if (null === $this->_dbTable) { $this->setDbTable('Application_Model_DbTable_BootMenu'); } return $this->_dbTable; } public function save(Application_Model_BootMenu $botmenu) { $data = array('bootmenuID'=> $botmenu->getBootmenuID() ,'membershipID'=> $botmenu->getMembershipID() ,'title'=> $botmenu->getTitle() ,'time'=> $botmenu->getTime() ); if (null === ($id = $botmenu->getID()) ) { unset($data['id']); $this->getDbTable()->insert($data); } else { $this->getDbTable()->update($data, array('id = ?' => $id)); } } public function find($id, Application_Model_BootMenu $botmenu) { $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; } $row = $result->current(); $botmenu->setBootmenuID($row->bootmenuID)->setMembershipID($row->membershipID)->setTitle($row->title)->setTime($row->time); } public function fetchAll() { $resultSet = $this->getDbTable()->fetchAll(); $entries = array(); foreach ($resultSet as $row) { $entry = new Application_Model_BootMenu(); $entry->setBootmenuID($row->bootmenuID)->setMembershipID($row->membershipID)->setTitle($row->title)->setTime($row->time); $entries[] = $entry; } return $entries; } }