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

_loadCacheBehaviorData() protected method

Loads CacheBehaviorData from simple xml object
protected _loadCacheBehaviorData ( SimpleXMLElement $sxml ) : Scalr\Service\Aws\CloudFront\DataType\CacheBehaviorData
$sxml SimpleXMLElement
return Scalr\Service\Aws\CloudFront\DataType\CacheBehaviorData Returns CacheBehaviorData
    protected function _loadCacheBehaviorData(\SimpleXMLElement $sxml)
    {
        $item = null;
        if ($this->exist($sxml)) {
            $item = new CacheBehaviorData();
            $item->setCloudFront($this->cloudFront);
            $item->forwardedValues = $this->_loadForwardedValuesData($sxml->ForwardedValues);
            $item->minTtl = $this->exist($sxml->MinTTL) ? $sxml->MinTTL - 0 : null;
            $item->defaultTtl = $this->exist($sxml->DefaultTTL) ? $sxml->DefaultTTL - 0 : null;
            $item->maxTtl = $this->exist($sxml->MaxTTL) ? $sxml->MaxTTL - 0 : null;
            $item->smoothStreaming = $this->exist($sxml->SmoothStreaming) ? (string) $sxml->SmoothStreaming == 'true' : null;
            $item->pathPattern = $this->exist($sxml->PathPattern) ? (string) $sxml->PathPattern : null;
            $item->targetOriginId = $this->exist($sxml->TargetOriginId) ? (string) $sxml->TargetOriginId : null;
            $item->trustedSigners = $this->_loadTrustedSignerList($sxml->TrustedSigners);
            $item->viewerProtocolPolicy = $this->exist($sxml->ViewerProtocolPolicy) ? (string) $sxml->ViewerProtocolPolicy : null;
            $item->allowedMethods = [];
            if (!empty($sxml->AllowedMethods->Items->Method)) {
                foreach ($sxml->AllowedMethods->Items->Method as $v) {
                    $item->allowedMethods[] = (string) $v;
                }
            }
            $item->cachedMethods = [];
            if (!empty($sxml->AllowedMethods->CachedMethods->Items->Method)) {
                foreach ($sxml->AllowedMethods->CachedMethods->Items->Method as $v) {
                    $item->cachedMethods[] = (string) $v;
                }
            }
        }
        return $item;
    }