add parent node to node, fix type of null
This commit is contained in:
parent
483110f773
commit
021a2a6f15
5 changed files with 24 additions and 1 deletions
|
|
@ -7,10 +7,17 @@ use App\Text\Text;
|
|||
class Node
|
||||
{
|
||||
public function __construct(
|
||||
private int $id,
|
||||
private string $title,
|
||||
private Text $text,
|
||||
private ?Node $parentNode,
|
||||
) {}
|
||||
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getTitle(): string
|
||||
{
|
||||
return $this->title;
|
||||
|
|
@ -20,4 +27,9 @@ class Node
|
|||
{
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
public function getParentNode(): ?Node
|
||||
{
|
||||
return $this->parentNode;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue