예제 #1
0
 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;
 }
예제 #2
0
파일: Product.php 프로젝트: NiniGeek/ZF-Try
 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;
 }