_dbTable = $dbTable; return $this; } public function getDbTable() { if (null === $this->_dbTable) { $this->setDbTable('Application_Model_DbTable_FilterType'); } return $this->_dbTable; } public function save(Application_Model_FilterType $filtertype) { $data = array('filtertypeID'=> $filtertype->getID() ,'filtertypename'=> $filtertype->getFiltertypename() ); if (null === ($id = $filtertype->getID()) ) { unset($data['filtertypeID']); $this->getDbTable()->insert($data); } else { $this->getDbTable()->update($data, array('filtertypeID = ?' => $id)); } } public function delete(Application_Model_FilterType $filtertype) { if (null === ($id = $filtertype->getID()) ) { return; } else { $this->getDbTable()->delete(array('filtertypeID = ?' => $id)); } } public function find($id, Application_Model_FilterType $filtertype) { $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; } $row = $result->current(); $filtertype->setID($row->filtertypeID) ->setFiltertypename($row->filtertypename); } public function fetchAll() { $resultSet = $this->getDbTable()->fetchAll(); $entries = array(); foreach ($resultSet as $row) { $entry = new Application_Model_FilterType(); $entry->setID($row->filtertypeID) ->setFiltertypename($row->filtertypename); $entries[] = $entry; } return $entries; } }