Horde_Xml_Element::__call PHP Method

__call() public method

Map method calls to get the string value of the requested element. If there are multiple elements that match, this will return an array of those objects.
public __call ( string $var, $unused ) : mixed
$var string The element to get the string value of.
return mixed The node's value, null, or an array of nodes.
    public function __call($var, $unused)
    {
        $nodes = $this->_children($var);
        if (!$nodes) {
            return null;
        } elseif (count($nodes) > 1) {
            if ($nodes[0] instanceof Horde_Xml_Element) {
                return $nodes;
            }
            return array_map(create_function('$e', 'return new Horde_Xml_Element($e);'), $nodes);
        } else {
            if ($nodes[0] instanceof Horde_Xml_Element) {
                return (string) $nodes[0];
            } else {
                return $nodes[0]->nodeValue;
            }
        }
    }