src/Entity/Round.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RoundRepository;
  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=RoundRepository::class)
  10.  */
  11. class Round
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      * @Groups({"round:list","round:item","event:list", "event:item"})
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="integer")
  22.      * @Groups({"round:list","round:item","event:list", "event:item"})
  23.      */
  24.     private $roundId;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      * @Groups({"round:list","round:item","event:list", "event:item"})
  28.      */
  29.     private $name;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      * @Groups({"round:list","round:item","event:list", "event:item"})
  33.      */
  34.     private $shortName;
  35.     /**
  36.      * @ORM\OneToMany(targetEntity=Fixture::class, mappedBy="round")
  37.      * @Groups({"round:list","round:item","event:list", "event:item"})
  38.      */
  39.     private $fixtures;
  40.     /**
  41.      * @ORM\ManyToOne(targetEntity=Event::class, inversedBy="rounds")
  42.      * @Groups({"round:list","round:item"})
  43.      */
  44.     private $event;
  45.     public function __construct()
  46.     {
  47.         $this->fixtures = new ArrayCollection();
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getRoundId(): ?int
  54.     {
  55.         return $this->roundId;
  56.     }
  57.     public function setRoundId(int $roundId): self
  58.     {
  59.         $this->roundId $roundId;
  60.         return $this;
  61.     }
  62.     public function getName(): ?string
  63.     {
  64.         return $this->name;
  65.     }
  66.     public function setName(string $name): self
  67.     {
  68.         $this->name $name;
  69.         return $this;
  70.     }
  71.     /**
  72.      * @return Collection<int, Fixture>
  73.      */
  74.     public function getFixtures(): Collection
  75.     {
  76.         return $this->fixtures;
  77.     }
  78.     public function addFixture(Fixture $fixture): self
  79.     {
  80.         if (!$this->fixtures->contains($fixture)) {
  81.             $this->fixtures[] = $fixture;
  82.             $fixture->setRound($this);
  83.         }
  84.         return $this;
  85.     }
  86.     public function removeFixture(Fixture $fixture): self
  87.     {
  88.         if ($this->fixtures->removeElement($fixture)) {
  89.             // set the owning side to null (unless already changed)
  90.             if ($fixture->getRound() === $this) {
  91.                 $fixture->setRound(null);
  92.             }
  93.         }
  94.         return $this;
  95.     }
  96.     public function getEvent(): ?Event
  97.     {
  98.         return $this->event;
  99.     }
  100.     public function setEvent(?Event $event): self
  101.     {
  102.         $this->event $event;
  103.         return $this;
  104.     }
  105.     /**
  106.      * @return mixed
  107.      */
  108.     public function getShortName()
  109.     {
  110.         return $this->shortName;
  111.     }
  112.     /**
  113.      * @param mixed $shortName
  114.      */
  115.     public function setShortName($shortName): void
  116.     {
  117.         $this->shortName $shortName;
  118.     }
  119. }