public function get($id) { try { $result = $this->perform([], \MsiClient\Client::GET_REQUEST, $this->getUrl() . '/' . $id); $product = new ProductProperties(); return $product->fromStdClass($result->data); } 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; }