src/Entity/DrawLine.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DrawLineRepository;
  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=DrawLineRepository::class)
  10.  */
  11. class DrawLine
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      * @Groups({"round:list", "round:item","drawline:list", "drawline:item","event:list","event:item"})
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="integer")
  22.      * @Groups({"round:list", "round:item","drawline:list", "drawline:item","event:list","event:item"})
  23.      */
  24.     private $drawLine;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      * @Groups({"round:list", "round:item","drawline:list", "drawline:item","event:list","event:item"})
  28.      */
  29.     private $seed;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      * @Groups({"round:list", "round:item","drawline:list", "drawline:item","event:list","event:item"})
  33.      */
  34.     private $teamCode;
  35.     /**
  36.      * @ORM\Column(type="integer")
  37.      * @Groups({"round:list", "round:item","drawline:list", "drawline:item","event:list","event:item"})
  38.      */
  39.     private $seedingRank;
  40.     /**
  41.      * @ORM\ManyToMany(targetEntity=Player::class, inversedBy="drawLines")
  42.      * @Groups({"round:list", "round:item","drawline:list", "drawline:item","event:list","event:item"})
  43.      */
  44.     private $players;
  45.     /**
  46.      * @ORM\OneToOne(targetEntity=Fixture::class, mappedBy="drawLineTop", cascade={"persist", "remove"})
  47.      */
  48.     private $fixture;
  49.     public function __construct()
  50.     {
  51.         $this->players = new ArrayCollection();
  52.     }
  53.     public function getId(): ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function getSeed(): ?string
  58.     {
  59.         return $this->seed;
  60.     }
  61.     public function setSeed(?string $seed): self
  62.     {
  63.         $this->seed $seed;
  64.         return $this;
  65.     }
  66.     public function getTeamCode(): ?string
  67.     {
  68.         return $this->teamCode;
  69.     }
  70.     public function setTeamCode(?string $teamCode): self
  71.     {
  72.         $this->teamCode $teamCode;
  73.         return $this;
  74.     }
  75.     public function getSeedingRank(): ?int
  76.     {
  77.         return $this->seedingRank;
  78.     }
  79.     public function setSeedingRank(int $seedingRank): self
  80.     {
  81.         $this->seedingRank $seedingRank;
  82.         return $this;
  83.     }
  84.     /**
  85.      * @return Collection<int, Player>
  86.      */
  87.     public function getPlayers(): Collection
  88.     {
  89.         return $this->players;
  90.     }
  91.     public function clearPlayers()
  92.     {
  93.         $this->players = new ArrayCollection();
  94.     }
  95.     public function addPlayer(Player $player): self
  96.     {
  97.         if (!$this->players->contains($player)) {
  98.             $this->players[] = $player;
  99.         }
  100.         return $this;
  101.     }
  102.     public function removePlayer(Player $player): self
  103.     {
  104.         $this->players->removeElement($player);
  105.         return $this;
  106.     }
  107.     public function getFixture(): ?Fixture
  108.     {
  109.         return $this->fixture;
  110.     }
  111.     public function setFixture(Fixture $fixture): self
  112.     {
  113.         // set the owning side of the relation if necessary
  114.         if ($fixture->getDrawLineTop() !== $this) {
  115.             $fixture->setDrawLineTop($this);
  116.         }
  117.         $this->fixture $fixture;
  118.         return $this;
  119.     }
  120.     /**
  121.      * @return mixed
  122.      */
  123.     public function getDrawLine()
  124.     {
  125.         return $this->drawLine;
  126.     }
  127.     /**
  128.      * @param mixed $drawLine
  129.      */
  130.     public function setDrawLine($drawLine): void
  131.     {
  132.         $this->drawLine $drawLine;
  133.     }
  134. }