protected function fromJsonElement($elements)
 {
     parent::fromJsonElement($elements);
     if (isset($elements->plan)) {
         unset($this->plan);
         $plan = new PlanProperties();
         $plan->fromJsonElement($elements->plan);
         $this->plan = $plan;
     }
     if (isset($elements->client)) {
         $client = new ClientProperties();
         $client->fromJsonElement($elements->client);
         $this->client = $client;
     }
     if (isset($elements->client_products)) {
         unset($this->client_products);
         $this->client_products = [];
         foreach ($elements->client_products as $client_product) {
             $cProducts = new ClientProductProperties();
             $cProducts->fromJsonElement($client_product);
             $this->client_products[] = $cProducts;
         }
     }
     return $this;
 }
示例#2
0
 /**
  * Sets plan
  *
  * @param   array|PlanProperties $plan Required for marketplace images
  * @return  VirtualMachineData
  */
 public function setPlan($plan = null)
 {
     if (!$plan instanceof PlanProperties) {
         $plan = PlanProperties::initArray($plan);
     }
     return $this->__call(__FUNCTION__, [$plan]);
 }