OEModule\PASAPI\resources\BaseResource::fromXml PHP Метод

fromXml() публичный статический Метод

Create an instance from an XML string.
public static fromXml ( $version, $xml, array $options = [] ) : null | BaseResource
$version
$xml
$options array
Результат null | BaseResource
    public static function fromXml($version, $xml, $options = array())
    {
        $doc = new \DOMDocument();
        if (!$xml) {
            return static::errorInit($version, array('Missing Resource Body'));
        }
        libxml_use_internal_errors(true);
        if (!$doc->loadXML($xml)) {
            $errors = array();
            foreach (libxml_get_errors() as $err) {
                $errors[] = $err->message;
            }
            $obj = static::errorInit($version, $errors);
            libxml_clear_errors();
            return $obj;
        }
        static::remapValues($doc, XpathRemap::model()->findAllByXpath('/' . static::$resource_type));
        $obj = static::fromXmlDom($version, $doc->documentElement, $options);
        $obj->addAuditData('input', \CHtml::encode($xml));
        return $obj;
    }