public function find($id) { $rowSet = $this->getDbTable()->find($id); $row = $rowSet->current(); $category = new Application_Model_Category(); $category->setId($row->c_id); $category->setLabel($row->c_label); return $category; }
public function find($id) { $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; } $row = $result->current(); $category = new Application_Model_Category(); $category->setId($row->id); $category->setName($row->name); return $category; }
public function getList() { $rowSet = $this->getDbTable()->fetchAll(); $categories = array(); foreach ($rowSet as $row) { $category = new Application_Model_Category(); $category->setId($row->c_id); //$category->setProducts($row->findDependentRowset('Application_Model_DbTable_Product')); $category->setLabel($row->c_label); $categories[] = $category; } return $categories; }
private function setModel($row) { $model = new Application_Model_Category(); $model->setId($row->id)->setName($row->name)->setStatus($row->status)->setParentId($row->parent_id)->setType($row->type)->setUrlText($row->url_text)->setUrlLink($row->url_link)->setImage($row->image)->setDescription($row->description)->setAddedon($row->addedon)->setUpdatedon($row->updatedon)->setWeight($row->weight); return $model; }
public function fetchAll() { $resultSet = $this->getDbTable()->fetchAll(); $entries = array(); foreach ($resultSet as $row) { $entry = new Application_Model_Category(); $entry->setId($row->id)->setAccountId($row->account_id)->setNickname($row->cate); $entries[] = $entry; } return $entries; }