src/Entity/Event.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EventRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. /**
  9.  * @ORM\Entity(repositoryClass=EventRepository::class)
  10.  */
  11. class Event
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255, nullable=true)
  21.      * @Groups({"event:list", "event:item","round:list","round:item"})
  22.      */
  23.     private $eventTypeCode;
  24.     /**
  25.      * @ORM\Column(type="text", nullable=true)
  26.      * @Groups({"event:list", "event:item","round:list","round:item"})
  27.      */
  28.     private $description;
  29.     /**
  30.      * @ORM\Column(type="integer")
  31.      * @Groups({"event:list", "event:item"})
  32.      */
  33.     private $drawSize;
  34.     /**
  35.      * @ORM\Column(type="integer", nullable=true)
  36.      * @Groups({"event:list", "event:item"})
  37.      */
  38.     private $numByes;
  39.     /**
  40.      * @ORM\Column(type="boolean")
  41.      * @Groups({"event:list", "event:item"})
  42.      */
  43.     private $hasRoundRobin;
  44.     /**
  45.      * @ORM\Column(type="boolean")
  46.      * @Groups({"event:list", "event:item","round:list","round:item"})
  47.      */
  48.     private $isTeamEvent;
  49.     /**
  50.      * @ORM\OneToMany(targetEntity=Breakdown::class, mappedBy="event")
  51.      * @Groups({"event:list", "event:item"})
  52.      */
  53.     private $breakdowns;
  54.     /**
  55.      * @ORM\OneToMany(targetEntity=Round::class, mappedBy="event")
  56.      * @Groups({"event:list", "event:item"})
  57.      */
  58.     private $rounds;
  59.     /**
  60.      * @ORM\Column(type="string", length=255, nullable=true)
  61.      * @Groups({"event:list", "event:item"})
  62.      */
  63.     private $roundRobinRound;
  64.     public function __construct()
  65.     {
  66.         $this->rounds = new ArrayCollection();
  67.         $this->breakdowns = new ArrayCollection();
  68.     }
  69.     public function getId(): ?int
  70.     {
  71.         return $this->id;
  72.     }
  73.     public function getEventTypeCode(): ?string
  74.     {
  75.         return $this->eventTypeCode;
  76.     }
  77.     public function setEventTypeCode(?string $eventTypeCode): self
  78.     {
  79.         $this->eventTypeCode $eventTypeCode;
  80.         return $this;
  81.     }
  82.     public function getDescription(): ?string
  83.     {
  84.         return $this->description;
  85.     }
  86.     public function setDescription(?string $description): self
  87.     {
  88.         $this->description $description;
  89.         return $this;
  90.     }
  91.     public function getDrawSize(): ?int
  92.     {
  93.         return $this->drawSize;
  94.     }
  95.     public function setDrawSize(int $drawSize): self
  96.     {
  97.         $this->drawSize $drawSize;
  98.         return $this;
  99.     }
  100.     public function getNumByes(): ?int
  101.     {
  102.         return $this->numByes;
  103.     }
  104.     public function setNumByes(?int $numByes): self
  105.     {
  106.         $this->numByes $numByes;
  107.         return $this;
  108.     }
  109.     public function isHasRoundRobin(): ?bool
  110.     {
  111.         return $this->hasRoundRobin;
  112.     }
  113.     public function setHasRoundRobin(bool $hasRoundRobin): self
  114.     {
  115.         $this->hasRoundRobin $hasRoundRobin;
  116.         return $this;
  117.     }
  118.     public function isIsTeamEvent(): ?bool
  119.     {
  120.         return $this->isTeamEvent;
  121.     }
  122.     public function setIsTeamEvent(bool $isTeamEvent): self
  123.     {
  124.         $this->isTeamEvent $isTeamEvent;
  125.         return $this;
  126.     }
  127.     /**
  128.      * @return Collection<int, Round>
  129.      */
  130.     public function getRounds(): Collection
  131.     {
  132.         return $this->rounds;
  133.     }
  134.     public function addRound(Round $round): self
  135.     {
  136.         if (!$this->rounds->contains($round)) {
  137.             $this->rounds[] = $round;
  138.             $round->setEvent($this);
  139.         }
  140.         return $this;
  141.     }
  142.     public function removeRound(Round $round): self
  143.     {
  144.         if ($this->rounds->removeElement($round)) {
  145.             // set the owning side to null (unless already changed)
  146.             if ($round->getEvent() === $this) {
  147.                 $round->setEvent(null);
  148.             }
  149.         }
  150.         return $this;
  151.     }
  152.     public function getRoundRobinRound(): ?string
  153.     {
  154.         return $this->roundRobinRound;
  155.     }
  156.     public function setRoundRobinRound(?string $roundRobinRound): self
  157.     {
  158.         $this->roundRobinRound $roundRobinRound;
  159.         return $this;
  160.     }
  161.     /**
  162.      * @return Collection|Breakdown[]
  163.      */
  164.     public function getBreakdowns(): Collection
  165.     {
  166.         return $this->breakdowns;
  167.     }
  168.     public function addBreakdown(Breakdown $breakdown): self
  169.     {
  170.         if (!$this->breakdowns->contains($breakdown)) {
  171.             $this->breakdowns[] = $breakdown;
  172.             $breakdown->setEvent($this);
  173.         }
  174.         return $this;
  175.     }
  176.     public function removeBreakdown(Breakdown $breakdown): self
  177.     {
  178.         if ($this->breakdowns->removeElement($breakdown)) {
  179.             // set the owning side to null (unless already changed)
  180.             if ($breakdown->getEvent() === $this) {
  181.                 $breakdown->setEvent(null);
  182.             }
  183.         }
  184.         return $this;
  185.     }
  186. }