CBitrixCloudCDNLocation::fromOptionValue: Bitrix method

      
<?php 
//  CBitrixCloudCDNLocation :: fromOptionValue()
//  /dist/bitrix/modules/bitrixcloud/classes/general/cdn_location.php:141

    
public static function fromOptionValue($name$valueCBitrixCloudCDNConfig $config)
    {
        
$values unserialize($value);
        
$proto "";
        
$prefixes /*.(array[int]string).*/ array();
        
$services /*.(array[string]string).*/ array();
        if (
is_array($values))
        {
            if (isset(
$values["prefixes"]) && is_array($values["prefixes"]))
            {
                foreach (
$values["prefixes"] as $prefix)
                    
$prefixes[] = $prefix;
            }
            if (isset(
$values["services"]) && is_array($values["services"]))
            {
                
$services $values["services"];
            }
            if (isset(
$values["proto"]))
            {
                
$proto $values["proto"];
            }
        }
        
$location = new CBitrixCloudCDNLocation($name$proto$prefixes);
        foreach (
$services as $file_class => $server_group)
        {
            
$location->addService($config->getClassByName($file_class), $config->getServerGroupByName($server_group));
        }
        return 
$location;
    }