<?phpnamespace App\Entity;use App\Repository\SorteoRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=SorteoRepository::class) * @ORM\Table(name="sorteo") */class Sorteo{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=200) */ private $nombre; /** * @ORM\Column(type="integer") */ private $anno; /** * @ORM\Column(type="date") */ private $fecha; /** * @ORM\OneToMany(targetEntity=Numeracion::class, mappedBy="sorteo", orphanRemoval=true, cascade={"persist", "remove"}) */ private $numeraciones; /** * @ORM\OneToMany(targetEntity=NumeroCompetencia::class, mappedBy="sorteo", orphanRemoval=true) */ private $numeroCompetencias; public function __construct() { $this->numeraciones = new ArrayCollection(); $this->numeroCompetencias = new ArrayCollection(); } public function __toString(): string { return $this->getNombre(); } public function getId(): ?int { return $this->id; } public function getNombre(): ?string { return $this->nombre; } public function setNombre(string $nombre): self { $this->nombre = $nombre; return $this; } public function getAnno(): ?int { return $this->anno; } public function setAnno(int $anno): self { $this->anno = $anno; return $this; } public function getFecha(): ?\DateTimeInterface { return $this->fecha; } public function setFecha(\DateTimeInterface $fecha): self { $this->fecha = $fecha; return $this; } /** * @return Collection<int, Numeracion> */ public function getNumeraciones(): Collection { return $this->numeraciones; } public function addNumeracion(Numeracion $numeracion): self { if (!$this->numeraciones->contains($numeracion)) { $this->numeraciones[] = $numeracion; $numeracion->setSorteo($this); } return $this; } public function removeNumeracion(Numeracion $numeracion): self { if ($this->numeraciones->removeElement($numeracion)) { // set the owning side to null (unless already changed) if ($numeracion->getSorteo() === $this) { $numeracion->setSorteo(null); } } return $this; } /** * @return Collection<int, NumeroCompetencia> */ public function getNumeroCompetencias(): Collection { return $this->numeroCompetencias; } public function addNumeroCompetencia(NumeroCompetencia $numeroCompetencia): self { if (!$this->numeroCompetencias->contains($numeroCompetencia)) { $this->numeroCompetencias[] = $numeroCompetencia; $numeroCompetencia->setSorteo($this); } return $this; } public function removeNumeroCompetencia(NumeroCompetencia $numeroCompetencia): self { if ($this->numeroCompetencias->removeElement($numeroCompetencia)) { // set the owning side to null (unless already changed) if ($numeroCompetencia->getSorteo() === $this) { $numeroCompetencia->setSorteo(null); } } return $this; }}