<?php
namespace App\Entity;
use App\Repository\UmpireRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Ignore;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=UmpireRepository::class)
*/
class Umpire
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"atpmatch_result:list", "atpmatch_result:item","event:list","event:item"})
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Groups({"atpmatch_result:list", "atpmatch_result:item","event:list","event:item"})
*
*/
private $name;
/**
* @ORM\Column(type="string", length=255)
* @Groups({"atpmatch_result:list", "atpmatch_result:item","event:list","event:item"})
*/
private $lastName;
/**
* @ORM\Column(type="string", length=255,nullable=true)
* @Groups({"atpmatch_result:list", "atpmatch_result:item","event:list","event:item"})
*/
private $country;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"atpmatch_result:list", "atpmatch_result:item","event:list","event:item"})
*/
private $officialId;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"atpmatch_result:list", "atpmatch_result:item","event:list","event:item"})
*/
private $officialItfId;
/**
* @ORM\OneToMany(targetEntity=Game::class, mappedBy="umpire")
* @Ignore()
*/
private $games;
/**
* @ORM\OneToMany(targetEntity=ATPMatchResult::class, mappedBy="umpire")
* @Ignore()
*/
private $aTPMatchResults;
public function __construct()
{
$this->games = new ArrayCollection();
$this->aTPMatchResults = new ArrayCollection();
}
public function __toString()
{
return $this->name.' '.$this->lastName;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(string $country): self
{
$this->country = $country;
return $this;
}
public function getOfficialId(): ?string
{
return $this->officialId;
}
public function setOfficialId(?string $officialId): self
{
$this->officialId = $officialId;
return $this;
}
public function getOfficialItfId(): ?string
{
return $this->officialItfId;
}
public function setOfficialItfId(?string $officialItfId): self
{
$this->officialItfId = $officialItfId;
return $this;
}
/**
* @return Collection|Game[]
*/
public function getGames(): Collection
{
return $this->games;
}
public function addGame(Game $game): self
{
if (!$this->games->contains($game)) {
$this->games[] = $game;
$game->setUmpire($this);
}
return $this;
}
public function removeGame(Game $game): self
{
if ($this->games->removeElement($game)) {
// set the owning side to null (unless already changed)
if ($game->getUmpire() === $this) {
$game->setUmpire(null);
}
}
return $this;
}
/**
* @return Collection|ATPMatchResult[]
*/
public function getATPMatchResults(): Collection
{
return $this->aTPMatchResults;
}
public function addATPMatchResult(ATPMatchResult $aTPMatchResult): self
{
if (!$this->aTPMatchResults->contains($aTPMatchResult)) {
$this->aTPMatchResults[] = $aTPMatchResult;
$aTPMatchResult->setUmpire($this);
}
return $this;
}
public function removeATPMatchResult(ATPMatchResult $aTPMatchResult): self
{
if ($this->aTPMatchResults->removeElement($aTPMatchResult)) {
// set the owning side to null (unless already changed)
if ($aTPMatchResult->getUmpire() === $this) {
$aTPMatchResult->setUmpire(null);
}
}
return $this;
}
}