/** * 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 node in an array representation that can be used for serialization * * @param bool $addChildNodes * @return array */ public function toArray($addChildNodes = TRUE) { $arrayRepresentation = parent::toArray(); $arrayRepresentation = array_merge($arrayRepresentation, array('label' => $this->label, 'type' => $this->type, 'class' => $this->class, 'icon' => $this->icon, 'callbackAction' => $this->callbackAction)); return $arrayRepresentation; }