src/Domain/Entity/ChapterAttributes.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use App\Domain\Entity\Behavior\Identifiable;
  4. use App\Domain\Entity\Enumeration\AttributeCategory;
  5. use Gedmo\Timestampable\Traits\Timestampable;
  6. /**
  7.  * Class ChapterAttributes
  8.  *
  9.  * @package App\Domain\Entity
  10.  */
  11. class ChapterAttributes
  12. {
  13.     use Identifiable;
  14.     use Timestampable;
  15.     /**
  16.      * @param string      $name
  17.      * @param int         $position
  18.      */
  19.     public function __construct(
  20.         public Chapter $chapter,
  21.         public Attribute $attribute,
  22.         public int $position,
  23.     ) {}
  24.     public function getCreatedAt()
  25.     {
  26.         return $this->createdAt;
  27.     }
  28.     public function getChapter(): Chapter
  29.     {
  30.         return $this->chapter;
  31.     }
  32.     public function getAttribute(): Attribute
  33.     {
  34.         return $this->attribute;
  35.     }
  36.     public function getPosition(): int
  37.     {
  38.         return $this->position;
  39.     }
  40.     public function setPosition(int $position): void
  41.     {
  42.         $this->position $position;
  43.     }
  44.     public function setChapter(Chapter $chapter): void
  45.     {
  46.         $this->chapter $chapter;
  47.     }
  48.     public function setAttribute(Attribute $attribute): void
  49.     {
  50.         $this->attribute $attribute;
  51.     }
  52.     public function getCategory(): AttributeCategory
  53.     {
  54.         return $this->attribute->category;
  55.     }
  56. }