public function getChildren() { $children = []; if ($this->entity->getChildren()) { foreach ($this->entity->getChildren() as $child) { $children[] = new self($child, $this->locale); } } return $children; }