Attainly/backend/app/Element/Element.php

52 lines
900 B
PHP

<?php
namespace App\Element;
use App\Set\Set;
use App\Set\SetLevel;
final readonly class Element
{
public function __construct(
private int $id,
private string $name,
private SetLevel $level,
private ?Element $parentElement,
private int $position,
) {}
public function getId(): int
{
return $this->id;
}
public function getName(): string
{
return $this->name;
}
public function getKind(): string
{
return $this->level->getKind();
}
public function getLevel(): SetLevel
{
return $this->level;
}
public function getSet(): Set
{
return $this->level->getSet();
}
public function getParentElement(): ?Element
{
return $this->parentElement;
}
public function getPosition(): int
{
return $this->position;
}
}