src/Entity/Lineup.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LineupRepository;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Uid\Uuid;
  7. /**
  8.  * @ORM\Entity(repositoryClass=LineupRepository::class)
  9.  */
  10. class Lineup
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\Column(type="uuid", unique=true)
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity=Stage::class, inversedBy="lineups")
  19.      * @ORM\JoinColumn(nullable=false)
  20.      */
  21.     private $stage;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=Artist::class, inversedBy="lineups")
  24.      */
  25.     private $artist;
  26.     /**
  27.      * @ORM\Column(type="datetime_immutable")
  28.      */
  29.     private $startAt;
  30.     /**
  31.      * @ORM\Column(type="datetime_immutable")
  32.      */
  33.     private $endAt;
  34.     /**
  35.      * @ORM\Column(type="text", nullable=true)
  36.      */
  37.     private $details;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity=Event::class)
  40.      */
  41.     private $stagesFilter;
  42.     public function __construct()
  43.     {
  44.         $this->id Uuid::v4();
  45.     }
  46.     public function getId(): Uuid
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getStage(): ?Stage
  51.     {
  52.         return $this->stage;
  53.     }
  54.     public function setStage(?Stage $stage): self
  55.     {
  56.         $this->stage $stage;
  57.         return $this;
  58.     }
  59.     public function getArtist(): ?Artist
  60.     {
  61.         return $this->artist;
  62.     }
  63.     public function setArtist(?Artist $artist): self
  64.     {
  65.         $this->artist $artist;
  66.         return $this;
  67.     }
  68.     public function getStartAt(): ?\DateTimeImmutable
  69.     {
  70.         return $this->startAt;
  71.     }
  72.     public function setStartAt(\DateTimeImmutable $startAt): self
  73.     {
  74.         $this->startAt $startAt;
  75.         return $this;
  76.     }
  77.     public function getEndAt(): ?\DateTimeImmutable
  78.     {
  79.         return $this->endAt;
  80.     }
  81.     public function setEndAt(\DateTimeImmutable $endAt): self
  82.     {
  83.         $this->endAt $endAt;
  84.         return $this;
  85.     }
  86.     public function getDetails(): ?string
  87.     {
  88.         return $this->details;
  89.     }
  90.     public function setDetails(?string $details): self
  91.     {
  92.         $this->details $details;
  93.         return $this;
  94.     }
  95.     public function getStagesFilter(): ?Event
  96.     {
  97.         if (!$this->stagesFilter) {
  98.             return $this->getStage()->getEvents()->first();
  99.         }
  100.         return $this->stagesFilter;
  101.     }
  102.     public function setStagesFilter(?Event $stagesFilter): self
  103.     {
  104.         $this->stagesFilter $stagesFilter;
  105.         return $this;
  106.     }
  107. }