src/Entity/Tribune.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TribuneRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassTribuneRepository::class)]
  8. class Tribune
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\ManyToOne]
  15.     private ?Events $event null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $nom null;
  18.     #[ORM\OneToMany(mappedBy'tribune'targetEntitySerieBillet::class)]
  19.     private Collection $serieBillets;
  20.     public function __construct()
  21.     {
  22.         $this->serieBillets = new ArrayCollection();
  23.     }
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getEvent(): ?Events
  29.     {
  30.         return $this->event;
  31.     }
  32.     public function setEvent(?Events $event): self
  33.     {
  34.         $this->event $event;
  35.         return $this;
  36.     }
  37.     public function getNom(): ?string
  38.     {
  39.         return $this->nom;
  40.     }
  41.     public function setNom(string $nom): self
  42.     {
  43.         $this->nom $nom;
  44.         return $this;
  45.     }
  46.     /**
  47.      * @return Collection<int, SerieBillet>
  48.      */
  49.     public function getSerieBillets(): Collection
  50.     {
  51.         return $this->serieBillets;
  52.     }
  53.     public function addSerieBillet(SerieBillet $serieBillet): self
  54.     {
  55.         if (!$this->serieBillets->contains($serieBillet)) {
  56.             $this->serieBillets->add($serieBillet);
  57.             $serieBillet->setTribune($this);
  58.         }
  59.         return $this;
  60.     }
  61.     public function removeSerieBillet(SerieBillet $serieBillet): self
  62.     {
  63.         if ($this->serieBillets->removeElement($serieBillet)) {
  64.             // set the owning side to null (unless already changed)
  65.             if ($serieBillet->getTribune() === $this) {
  66.                 $serieBillet->setTribune(null);
  67.             }
  68.         }
  69.         return $this;
  70.     }
  71.     public function __toString()
  72.     {
  73.         return $this->getNom();
  74.     }
  75.     public function __clone(): void
  76.     {
  77.         if ($this->id) {
  78.             $this->id null;
  79.             $this->event null;
  80.             $this->serieBillets = new ArrayCollection();
  81.         }
  82.     }
  83. }