public function addObject($object, $cdata = false, $key = false)
    {
        if (!is_object($object) && !is_array($object)) {
            return;
        }

        if ($key && Conversion::validateNodeName($key)) {
            $key = $this->dom->createElement($key);
            $conversion = new Conversion($object);
            $conversion->objectToDomElement($object, $key, $this->dom);
        } else {
            $conversion = new Conversion($object);
            $conversion->objectToDomElement($object, $this->page, $this->dom);
        }
    }
public function addObject($object, $cdata = false, $key = false)
    {
        if (!is_object($object) && !is_array($object)) {
            return;
        }

        if ($key && Conversion::validateNodeName($key)) {
            $key = $this->dom->createElement($key);
            $conversion = new Conversion($object);
            $conversion->objectToDomElement($object, $key, $this->dom);
        } else {
            $conversion = new Conversion($object);
            $conversion->objectToDomElement($object, $this->page, $this->dom);
        }
    }
public function addObject ( $ object , $ cdata = false , $ key = false ) { if ( ! is_object ( $ object ) && ! is_array ( $ object ) ) { return ; } if ( $ key && Conversion :: validateNodeName ( $ key ) ) { $ key = $ this -> dom -> createElement ( $ key ) ; $ conversion = new Conversion ( $ object ) ; $ conversion -> objectToDomElement ( $ object , $ key , $ this -> dom ) ; } else { $ conversion = new Conversion ( $ object ) ; $ conversion -> objectToDomElement ( $ object , $ this -> page , $ this -> dom ) ; } }
Adds an object to XML tree.

$object parameter can also be an array but array keys must be strings.

@todo    Validate $object

@param object $object XMLVars object
@param bool   $cdata  Defines if we create CDATA section to XMLtree
@param mixed  $key    Optional nodename to put XML data under. If false,
data is put to page root, otherwise to XML-root.
Adds an object to XML tree .