Exemplo n.º 1
0
 public function ryi($params)
 {
     $this->session->setRequestToken($params['AuthToken']);
     $scope = $params['scope'];
     $req = new ReviseItemRequestType();
     $item = new ItemType();
     $item->setItemID($params['ItemID']);
     if (in_array('description', $scope)) {
         $item->setDescription($params['Description']);
     }
     if (in_array('sku', $scope)) {
         $item->setApplicationData($params['ApplicationData']);
         $item->setSKU($params['SKU']);
     }
     $item->setHitCounter("HiddenStyle");
     $req->setItem($item);
     $res = $this->proxy->ReviseItem($req);
     switch ($res->getAck()) {
         case AckCodeType::CodeType_Success:
             return true;
             break;
         case AckCodeType::CodeType_Warning:
             echo "Item ID: {$params['ItemID']}<br>";
             echo $this->proxy->getErrorsToString($res, true);
             return true;
             break;
         default:
             echo "Item ID: {$params['ItemID']}<br>";
             echo $this->proxy->getErrorsToString($res, true);
             $this->dumpObject($res);
             return false;
             break;
     }
 }