/**
  * Returns the node in an array representation that can be used for serialization
  *
  * @param bool $addChildNodes
  * @return array
  */
 public function toArray($addChildNodes = TRUE)
 {
     $arrayRepresentation = array('serializeClassName' => get_class($this), 'id' => $this->id);
     if ($this->parentNode !== NULL) {
         $arrayRepresentation['parentNode'] = $this->parentNode->toArray(FALSE);
     } else {
         $arrayRepresentation['parentNode'] = '';
     }
     if ($this->hasChildNodes() && $addChildNodes) {
         $arrayRepresentation['childNodes'] = $this->childNodes->toArray();
     } else {
         $arrayRepresentation['childNodes'] = '';
     }
     return $arrayRepresentation;
 }
 /**
  * Returns the collection in an array representation for e.g. serialization
  *
  * @return array
  */
 public function toArray()
 {
     $arrayRepresentation = parent::toArray();
     unset($arrayRepresentation['serializeClassName']);
     return $arrayRepresentation;
 }
 /**
  * Adds a node to the internal list in a sorted approach
  *
  * @param t3lib_tree_Node $node
  * @return void
  */
 public function append(t3lib_tree_Node $node)
 {
     parent::append($node);
     $this->asort();
     $this->normalize();
 }