function &prependChild($child) { if (!$this->_validateChild($child)) { _MiniXMLLog("MiniXMLElement::prependChild - Could not validate child, aborting."); return _MiniXMLReturnNullByRef(); } /* Set the parent for the child element to this element if ** avoidLoops or MINIXML_AUTOSETPARENT is set */ if ($this->xavoidLoops || MINIXML_AUTOSETPARENT > 0) { if ($this->xparent == $child) { $cname = $child->name(); return _MiniXMLError("MiniXMLElement::prependChild() Tryng to append parent {$cname} as child of " . $this->xname); } $child->parent($this); } $this->xnumElementChildren++; /* Note that we're adding a MiniXMLElement child */ /* Add the child to the list */ $idx = $this->xnumChildren++; array_unshift($this->xchildren, $child); return $this->xchildren[0]; }
function &getElement($name) { return _MiniXMLReturnNullByRef(); }