Scalr\Service\Aws\Client\SoapClient::_addRefInternal PHP Метод

_addRefInternal() защищенный Метод

protected _addRefInternal ( $sinfoNode, $node, $algorithm, $arTransforms = null, $options = null )
    protected function _addRefInternal($sinfoNode, $node, $algorithm, $arTransforms = null, $options = null)
    {
        $prefix = null;
        $prefix_ns = null;
        $id_name = 'Id';
        $overwrite_id = true;
        $force_uri = false;
        if (is_array($options)) {
            $prefix = empty($options['prefix']) ? null : $options['prefix'];
            $prefix_ns = empty($options['prefix_ns']) ? null : $options['prefix_ns'];
            $id_name = empty($options['id_name']) ? 'Id' : $options['id_name'];
            $overwrite_id = !isset($options['overwrite']) ? true : (bool) $options['overwrite'];
            $force_uri = !isset($options['force_uri']) ? false : (bool) $options['force_uri'];
        }
        $attname = $id_name;
        if (!empty($prefix)) {
            $attname = $prefix . ':' . $attname;
        }
        $refNode = $this->_createNewSignNode('Reference');
        $sinfoNode->appendChild($refNode);
        if (!$node instanceof \DOMDocument) {
            $uri = null;
            if (!$overwrite_id) {
                $uri = $node->getAttributeNS($prefix_ns, $attname);
            }
            if (empty($uri)) {
                $uri = self::_generateGuid();
                $node->setAttributeNS($prefix_ns, $attname, $uri);
            }
            $refNode->setAttribute("URI", '#' . $uri);
        } elseif ($force_uri) {
            $refNode->setAttribute("URI", '');
        }
        $transNodes = $this->_createNewSignNode('Transforms');
        $refNode->appendChild($transNodes);
        if (is_array($arTransforms)) {
            foreach ($arTransforms as $transform) {
                $transNode = $this->_createNewSignNode('Transform');
                $transNodes->appendChild($transNode);
                if (is_array($transform) && !empty($transform['http://www.w3.org/TR/1999/REC-xpath-19991116']) && !empty($transform['http://www.w3.org/TR/1999/REC-xpath-19991116']['query'])) {
                    $transNode->setAttribute('Algorithm', 'http://www.w3.org/TR/1999/REC-xpath-19991116');
                    $XPathNode = $this->_createNewSignNode('XPath', $transform['http://www.w3.org/TR/1999/REC-xpath-19991116']['query']);
                    $transNode->appendChild($XPathNode);
                    if (!empty($transform['http://www.w3.org/TR/1999/REC-xpath-19991116']['namespaces'])) {
                        foreach ($transform['http://www.w3.org/TR/1999/REC-xpath-19991116']['namespaces'] as $prefix => $namespace) {
                            $XPathNode->setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:{$prefix}", $namespace);
                        }
                    }
                } else {
                    $transNode->setAttribute('Algorithm', $transform);
                }
            }
        } elseif (!empty($this->canonicalMethod)) {
            $transNode = $this->_createNewSignNode('Transform');
            $transNodes->appendChild($transNode);
            $transNode->setAttribute('Algorithm', $this->canonicalMethod);
        }
        $canonicalData = $this->_processTransforms($refNode, $node);
        $digValue = $this->_calculateDigest($algorithm, $canonicalData);
        $digestMethod = $this->_createNewSignNode('DigestMethod');
        $refNode->appendChild($digestMethod);
        $digestMethod->setAttribute('Algorithm', $algorithm);
        $digestValue = $this->_createNewSignNode('DigestValue', $digValue);
        $refNode->appendChild($digestValue);
    }