OEModule\PASAPI\resources\BaseResource::fromXmlDom PHP Method

fromXmlDom() public static method

instantiates a resource with the given XML Document.
public static fromXmlDom ( $version, DOMElement $element, array $options = [] ) : static
$version
$element DOMElement \DOMElement
$options array
return static
    public static function fromXmlDom($version, \DOMElement $element, $options = array())
    {
        if ($element->tagName != static::$resource_type) {
            return static::errorInit($version, array("Mismatched root tag {$element->tagName} for resource type " . static::$resource_type));
        }
        $obj = new static($version, $options);
        $obj->parseXml($element, $options);
        return $obj;
    }