private function ProductInsertUpdate() { try { $soapClient = VtexSoap::createSoapclient(); $result = $soapClient->ProductInsertUpdate(array('productVO' => $this)); if (is_object($result) and property_exists($result, 'ProductInsertUpdateResult')) { return (is_object($result->ProductInsertUpdateResult) and property_exists($result->ProductInsertUpdateResult, 'Id')) ? $result->ProductInsertUpdateResult : NULL; } return NULL; } catch (SoapFault $e) { VtexSoap::setResponseHeader($soapClient); $message = "Falha no processo de Integração. Método: " . __METHOD__; $messageVtex = json_encode(array('message' => $e->getMessage())); Handler::error($message, $messageVtex); } }
private function StockKeepingUnitImageRemove() { try { $soapClient = VtexSoap::createSoapclient(); $result = $soapClient->StockKeepingUnitImageRemove($this); return is_object($result) ? true : false; } catch (SoapFault $e) { VtexSoap::setResponseHeader($soapClient); $message = "Falha no processo de Integração. Método: " . __METHOD__; $messageVtex = json_encode(array('message' => $e->getMessage())); Handler::error($message, $messageVtex); } }
private function active($data) { $this->populate($data); try { $soapClient = VtexSoap::createSoapclient(); $result = $soapClient->StockKeepingUnitActive(array('idStockKeepingUnit' => $this->idStockKeepingUnit)); if (is_object($result)) { $message = 'Flag Ativar Sku se possível ativada com sucesso'; Handler::success($message, json_encode(array("result" => "true"))); } else { $message = 'Flag Ativar Sku se possível não foi ativada'; Handler::error($message, json_encode(array("result" => "false"))); } } catch (SoapFault $e) { VtexSoap::setResponseHeader($soapClient); $message = "Falha no processo de Integração. Método: " . __METHOD__; $messageVtex = json_encode(array('message' => $e->getMessage())); Handler::error($message, $messageVtex); } }