text = $text; $this->href = $href; $this->nodes = $nodes; } /** * Returns the node text. * @return string */ public function getText(): string { return $this->text; } /** * Sets the node text * @param string $text The new node text. * @return TreeViewNode */ public function setText(string $text): self { $this->text = $text; return $this; } /** * Returns the href link. * @return string|null */ public function getHref(): ?string { return $this->href; } /** * Sets the href link. * @param string|null $href The new href link. * @return TreeViewNode */ public function setHref(?string $href): self { $this->href = $href; return $this; } /** * Returns the children nodes of this node. * @return array|null */ public function getNodes(): ?array { return $this->nodes; } /** * Sets the children nodes. * @param array|null $nodes The new children nodes * @return TreeViewNode */ public function setNodes(?array $nodes): self { $this->nodes = $nodes; return $this; } }