/** * * @param CBitrixCloudOption $option * @return CBitrixCloudCDNClasses * */ public static function fromOption(CBitrixCloudOption $option) { $classes = new CBitrixCloudCDNClasses(); foreach ($option->getArrayValue() as $class_name => $extensions) { $classes->addClass(new CBitrixCloudCDNClass($class_name, explode(",", $extensions))); } return $classes; }
/** * Loads configuration from CBitrixCloudOption * * @return CBitrixCloudCDNConfig * */ public function loadFromOptions() { $this->active = intval(CBitrixCloudOption::getOption("cdn_config_active")->getStringValue()); $this->expires = intval(CBitrixCloudOption::getOption("cdn_config_expire_time")->getStringValue()); $this->domain = CBitrixCloudOption::getOption("cdn_config_domain")->getStringValue(); $this->sites = CBitrixCloudOption::getOption("cdn_config_site")->getArrayValue(); $this->quota = CBitrixCloudCDNQuota::fromOption(CBitrixCloudOption::getOption("cdn_config_quota")); $this->classes = CBitrixCloudCDNClasses::fromOption(CBitrixCloudOption::getOption("cdn_class")); $this->server_groups = CBitrixCloudCDNServerGroups::fromOption(CBitrixCloudOption::getOption("cdn_server_group")); $this->locations = CBitrixCloudCDNLocations::fromOption(CBitrixCloudOption::getOption("cdn_location"), $this); return $this; }