Scalr\Service\Aws\CloudFront\V20150727\CloudFrontApi::_loadGeoRestrictionData PHP Method

_loadGeoRestrictionData() protected method

Loads GeoRestrictionData from simple xml object
protected _loadGeoRestrictionData ( SimpleXMLElement $sxml ) : Scalr\Service\Aws\CloudFront\DataType\GeoRestrictionData
$sxml SimpleXMLElement
return Scalr\Service\Aws\CloudFront\DataType\GeoRestrictionData Returns GeoRestrictionData
    protected function _loadGeoRestrictionData(\SimpleXMLElement $sxml)
    {
        $item = null;
        if ($this->exist($sxml)) {
            $item = new GeoRestrictionData();
            $item->setCloudFront($this->cloudFront);
            $item->restrictionType = $this->exist($sxml->RestrictionType) ? (string) $sxml->RestrictionType : null;
            $item->locations = [];
            if (!empty($sxml->Items->Location)) {
                foreach ($sxml->Items->Location as $v) {
                    $item->locations[] = (string) $v;
                }
            }
        }
        return $item;
    }