Api\StructType\ApiItem::getAny PHP Method

getAny() public method

Get any value
public getAny ( boolean $asString = true ) : DOMDocument | null
$asString boolean true: returns XML string, false: returns \DOMDocument
return DOMDocument | null
    public function getAny($asString = true)
    {
        if (!empty($this->any) && !$this->any instanceof \DOMDocument) {
            $dom = new \DOMDocument('1.0', 'UTF-8');
            $dom->formatOutput = true;
            if ($dom->loadXML($this->any)) {
                $this->setAny($dom);
            }
            unset($dom);
        }
        return $asString && $this->any instanceof \DOMDocument && $this->any->hasChildNodes() ? $this->any->saveXML($this->any->childNodes->item(0)) : $this->any;
    }