public function update(ClientProductConfigurationProperties $config) { try { $formatter = Formatter::create(\MsiClient\Client::Formart_Request); return $this->perform(['data' => $formatter->encode(['client_product_config' => $config->toArray()])], \MsiClient\Client::PUT_REQUEST, $this->getUrl() . '/' . $config->client_product_id . '-' . $config->product_configuration_id); } catch (\Exception $e) { throw $e; } }
protected function fromJsonElement($elements) { parent::fromJsonElement($elements); $product = new ProductProperties(); $this->product = []; if (isset($elements->product)) { $this->product = $product->fromJsonElement($elements->product); } unset($this->client_configuration); $this->product_configurations = []; if (isset($elements->client_configuration)) { foreach ($elements->client_configuration as $value) { $cConfg = new ClientProductConfigurationProperties(); $this->product_configurations[] = $cConfg->fromJsonElement($value); } } if (isset($elements->client)) { unset($this->client); $this->client = []; $client = new ClientProperties(); $this->client = $client->fromStdClass($elements->client); } return $this; }