Esempio n. 1
0
 public function listImgsGetTest()
 {
     $productId = '5';
     $data = '["1","3","4"]';
     $attr = json_decode($data);
     $da = new AttributeValueDa();
     $result = $da->updateAttributeValues($productId, $attr);
     echo $result;
 }
Esempio n. 2
0
 public function updateAttributeTest()
 {
     $productId = '16';
     $attrData = '["1","16","6","7"]';
     $imgData = '{"tempImgIds":["90"],"defaultImgId":"90"}';
     try {
         $attr = json_decode($attrData);
         $img = json_decode($imgData);
         $attrValueDa = new AttributeValueDa();
         $attrResult = $attrValueDa->updateAttributeValues($productId, $attr);
         $imageDa = new ImageDa();
         $imageResult = $imageDa->updateProductImage($productId, $img);
         $result = $attrResult + $imageResult;
         echo $result;
     } catch (Exception $e) {
         echo 'Caught exception: ', $e->getMessage(), "\n";
     }
 }