You are here

function JSimpleXMLElement::addChild in Ubercart 5

Adds a direct child to the element

Parameters

string $name:

array $attrs:

int $level:

File

uc_store/includes/simplexml.php, line 540

Class

JSimpleXMLElement
SimpleXML Element

Code

function addChild($name, $attrs, $level) {

  //If there is no array already set for the tag name being added,

  //create an empty array for it
  if (!isset($this->{$name})) {
    $this->{$name} = array();
  }

  //Create the child object itself
  $child = new JSimpleXMLElement($name, $attrs, $level);

  //Add the reference of it to the end of an array member named for the elements name
  $this->{$name}[] =& $child;

  //Add the reference to the children array member
  $this->_children[] =& $child;
}