Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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;
 }