Пример #1
0
 public function deleteAction()
 {
     $id = $this->_getParam('id');
     $p = Model_Product::findbyId($id);
     if (!$p) {
         throw new Exception("Product id '" . $id . "' not found.");
     }
     $p->delete();
     echo json_encode(array('success' => true));
 }
Пример #2
0
 public function removeMemberAction()
 {
     $product_id = $this->_getParam('product_id');
     $p = Model_Product::findbyId($product_id);
     if (!$p) {
         throw new Exception("Product id '" . $product_id . "' not found.");
     }
     $p = Model_Product::findbyId($product_id);
     $p->category_id = 0;
     $p->save();
     echo json_encode(array('success' => true));
 }