public function getListByCategoryId($category) { $rowSet = $this->getDbTable()->fetchAll("c_id = {$category}"); $products = array(); foreach ($rowSet as $row) { $product = new Application_Model_Product(); $product->setId($row->p_id); $product->setLabel($row->p_label); $product->setDesc($row->p_desc); $products[] = $product; } return $products; }
public function getListByCategoryId($id) { $where = 'c_id = ' . $id; $rowSet = $this->getDbTable()->fetchAll($where); $products = array(); foreach ($rowSet as $row) { $product = new Application_Model_Product(); $product->setId($row->p_id); $product->setLabel($row->p_label); $product->setDescription($row->p_description); $product->setPrice($row->p_price); $product->setCid($row->c_id); $products[] = $product; } return $products; }