<?php
namespace App\Domain\Entity;
use App\Domain\Entity\Behavior\Identifiable;
use App\Domain\Entity\Enumeration\AttributeCategory;
use Gedmo\Timestampable\Traits\Timestampable;
/**
* Class ChapterAttributes
*
* @package App\Domain\Entity
*/
class ChapterAttributes
{
use Identifiable;
use Timestampable;
/**
* @param string $name
* @param int $position
*/
public function __construct(
public Chapter $chapter,
public Attribute $attribute,
public int $position,
) {}
public function getCreatedAt()
{
return $this->createdAt;
}
public function getChapter(): Chapter
{
return $this->chapter;
}
public function getAttribute(): Attribute
{
return $this->attribute;
}
public function getPosition(): int
{
return $this->position;
}
public function setPosition(int $position): void
{
$this->position = $position;
}
public function setChapter(Chapter $chapter): void
{
$this->chapter = $chapter;
}
public function setAttribute(Attribute $attribute): void
{
$this->attribute = $attribute;
}
public function getCategory(): AttributeCategory
{
return $this->attribute->category;
}
}