initParams(); $this->initServices(); $this->api(); $this->initVm(); $container = []; $rate = null; if ($this->getWhmcsConfigOption(ConfigurableOption::NETWORK_RATE,$this->configuration()->getRate()) && $this->getWhmcsConfigOption(ConfigurableOption::NETWORK_RATE,$this->configuration()->getRate()) != "-1") { $rate = $this->getWhmcsConfigOption(ConfigurableOption::NETWORK_RATE,$this->configuration()->getRate()) ; } foreach (sl('Vm')->getVm()->getNetworkDevices($this->configuration()->getBridge()) as $entity) { $hash = $entity->getHashCode(); if ($entity->getRate() != $rate) { $entity->setRate($rate); } if ($hash != $entity->getHashCode()) { $container[$entity->getId()] = $entity->asConfig(); } } if (!empty($container)) { sl('Vm')->getVm()->updateConfig($container); } } }