Recurly_Base::__parseXmlToUpdateObject PHP Méthode

__parseXmlToUpdateObject() protected méthode

Use the XML to update $this object.
protected __parseXmlToUpdateObject ( $xml )
    protected function __parseXmlToUpdateObject($xml)
    {
        $dom = new DOMDocument();
        if (empty($xml) || !$dom->loadXML($xml, LIBXML_NOBLANKS)) {
            return null;
        }
        $rootNode = $dom->documentElement;
        if ($rootNode->nodeName == $this->getNodeName()) {
            // update the current object
            Recurly_Resource::__parseXmlToObject($rootNode->firstChild, $this);
        } else {
            if ($rootNode->nodeName == 'errors') {
                // add element to existing object
                Recurly_Resource::__parseXmlToObject($rootNode->firstChild, $this->_errors);
            }
        }
        $this->updateErrorAttributes();
    }