src/Entity/Umpire.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UmpireRepository;
  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\Ignore;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. /**
  10.  * @ORM\Entity(repositoryClass=UmpireRepository::class)
  11.  */
  12. class Umpire
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      * @Groups({"atpmatch_result:list", "atpmatch_result:item","event:list","event:item"})
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      * @Groups({"atpmatch_result:list", "atpmatch_result:item","event:list","event:item"})
  24.      *
  25.      */
  26.     private $name;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      * @Groups({"atpmatch_result:list", "atpmatch_result:item","event:list","event:item"})
  30.      */
  31.     private $lastName;
  32.     /**
  33.      * @ORM\Column(type="string", length=255,nullable=true)
  34.      * @Groups({"atpmatch_result:list", "atpmatch_result:item","event:list","event:item"})
  35.      */
  36.     private $country;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      * @Groups({"atpmatch_result:list", "atpmatch_result:item","event:list","event:item"})
  40.      */
  41.     private $officialId;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      * @Groups({"atpmatch_result:list", "atpmatch_result:item","event:list","event:item"})
  45.      */
  46.     private $officialItfId;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity=Game::class, mappedBy="umpire")
  49.      * @Ignore()
  50.      */
  51.     private $games;
  52.     /**
  53.      * @ORM\OneToMany(targetEntity=ATPMatchResult::class, mappedBy="umpire")
  54.      * @Ignore()
  55.      */
  56.     private $aTPMatchResults;
  57.     public function __construct()
  58.     {
  59.         $this->games = new ArrayCollection();
  60.         $this->aTPMatchResults = new ArrayCollection();
  61.     }
  62.     public function __toString()
  63.     {
  64.         return $this->name.' '.$this->lastName;
  65.     }
  66.     public function getId(): ?int
  67.     {
  68.         return $this->id;
  69.     }
  70.     public function getName(): ?string
  71.     {
  72.         return $this->name;
  73.     }
  74.     public function setName(string $name): self
  75.     {
  76.         $this->name $name;
  77.         return $this;
  78.     }
  79.     public function getLastName(): ?string
  80.     {
  81.         return $this->lastName;
  82.     }
  83.     public function setLastName(string $lastName): self
  84.     {
  85.         $this->lastName $lastName;
  86.         return $this;
  87.     }
  88.     public function getCountry(): ?string
  89.     {
  90.         return $this->country;
  91.     }
  92.     public function setCountry(string $country): self
  93.     {
  94.         $this->country $country;
  95.         return $this;
  96.     }
  97.     public function getOfficialId(): ?string
  98.     {
  99.         return $this->officialId;
  100.     }
  101.     public function setOfficialId(?string $officialId): self
  102.     {
  103.         $this->officialId $officialId;
  104.         return $this;
  105.     }
  106.     public function getOfficialItfId(): ?string
  107.     {
  108.         return $this->officialItfId;
  109.     }
  110.     public function setOfficialItfId(?string $officialItfId): self
  111.     {
  112.         $this->officialItfId $officialItfId;
  113.         return $this;
  114.     }
  115.     /**
  116.      * @return Collection|Game[]
  117.      */
  118.     public function getGames(): Collection
  119.     {
  120.         return $this->games;
  121.     }
  122.     public function addGame(Game $game): self
  123.     {
  124.         if (!$this->games->contains($game)) {
  125.             $this->games[] = $game;
  126.             $game->setUmpire($this);
  127.         }
  128.         return $this;
  129.     }
  130.     public function removeGame(Game $game): self
  131.     {
  132.         if ($this->games->removeElement($game)) {
  133.             // set the owning side to null (unless already changed)
  134.             if ($game->getUmpire() === $this) {
  135.                 $game->setUmpire(null);
  136.             }
  137.         }
  138.         return $this;
  139.     }
  140.     /**
  141.      * @return Collection|ATPMatchResult[]
  142.      */
  143.     public function getATPMatchResults(): Collection
  144.     {
  145.         return $this->aTPMatchResults;
  146.     }
  147.     public function addATPMatchResult(ATPMatchResult $aTPMatchResult): self
  148.     {
  149.         if (!$this->aTPMatchResults->contains($aTPMatchResult)) {
  150.             $this->aTPMatchResults[] = $aTPMatchResult;
  151.             $aTPMatchResult->setUmpire($this);
  152.         }
  153.         return $this;
  154.     }
  155.     public function removeATPMatchResult(ATPMatchResult $aTPMatchResult): self
  156.     {
  157.         if ($this->aTPMatchResults->removeElement($aTPMatchResult)) {
  158.             // set the owning side to null (unless already changed)
  159.             if ($aTPMatchResult->getUmpire() === $this) {
  160.                 $aTPMatchResult->setUmpire(null);
  161.             }
  162.         }
  163.         return $this;
  164.     }
  165. }