src/Entity/Chorales.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ChoralesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use App\Traits\TimeStampTraits;
  9. #[ORM\Entity(repositoryClassChoralesRepository::class)]
  10. #[ORM\HasLifecycleCallbacks]
  11. class Chorales
  12. {
  13.     use TimeStampTraits;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\Column(length255)]
  19.     #[Assert\NotBlank(message"Oops! Veuillez renseigner ce champ.")]
  20.     private ?string $libelle null;
  21.     #[ORM\Column(length25nullabletrue)]
  22.     private ?string $abreviation null;
  23.     #[ORM\OneToMany(mappedBy'chorale'targetEntityChoraleMembres::class, orphanRemovaltrue)]
  24.     private Collection $choraleMembres;
  25.     #[ORM\OneToMany(mappedBy'chorale'targetEntityEntrees::class)]
  26.     private Collection $entrees;
  27.     #[ORM\OneToMany(mappedBy'chorale'targetEntityAdherentProjets::class)]
  28.     private Collection $adherentProjets;
  29.     #[ORM\OneToMany(mappedBy'chorale'targetEntityConfigurationDonReconnaissance::class)]
  30.     private Collection $configurationDonReconnaissances;
  31.     public function __construct()
  32.     {
  33.         $this->choraleMembres = new ArrayCollection();
  34.         $this->entrees = new ArrayCollection();
  35.         $this->adherentProjets = new ArrayCollection();
  36.         $this->configurationDonReconnaissances = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getLibelle(): ?string
  43.     {
  44.         return $this->libelle;
  45.     }
  46.     public function setLibelle(string $libelle): static
  47.     {
  48.         $this->libelle $libelle;
  49.         return $this;
  50.     }
  51.     public function getAbreviation(): ?string
  52.     {
  53.         return $this->abreviation;
  54.     }
  55.     public function setAbreviation(?string $abreviation): static
  56.     {
  57.         $this->abreviation $abreviation;
  58.         return $this;
  59.     }
  60.     /**
  61.      * @return Collection<int, ChoraleMembres>
  62.      */
  63.     public function getChoraleMembres(): Collection
  64.     {
  65.         return $this->choraleMembres;
  66.     }
  67.     public function addChoraleMembre(ChoraleMembres $choraleMembre): static
  68.     {
  69.         if (!$this->choraleMembres->contains($choraleMembre)) {
  70.             $this->choraleMembres->add($choraleMembre);
  71.             $choraleMembre->setChorale($this);
  72.         }
  73.         return $this;
  74.     }
  75.     public function removeChoraleMembre(ChoraleMembres $choraleMembre): static
  76.     {
  77.         if ($this->choraleMembres->removeElement($choraleMembre)) {
  78.             // set the owning side to null (unless already changed)
  79.             if ($choraleMembre->getChorale() === $this) {
  80.                 $choraleMembre->setChorale(null);
  81.             }
  82.         }
  83.         return $this;
  84.     }
  85.     /**
  86.      * @return Collection<int, Entrees>
  87.      */
  88.     public function getEntrees(): Collection
  89.     {
  90.         return $this->entrees;
  91.     }
  92.     public function addEntree(Entrees $entree): static
  93.     {
  94.         if (!$this->entrees->contains($entree)) {
  95.             $this->entrees->add($entree);
  96.             $entree->setChorale($this);
  97.         }
  98.         return $this;
  99.     }
  100.     public function removeEntree(Entrees $entree): static
  101.     {
  102.         if ($this->entrees->removeElement($entree)) {
  103.             // set the owning side to null (unless already changed)
  104.             if ($entree->getChorale() === $this) {
  105.                 $entree->setChorale(null);
  106.             }
  107.         }
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Collection<int, AdherentProjets>
  112.      */
  113.     public function getAdherentProjets(): Collection
  114.     {
  115.         return $this->adherentProjets;
  116.     }
  117.     public function addAdherentProjet(AdherentProjets $adherentProjet): static
  118.     {
  119.         if (!$this->adherentProjets->contains($adherentProjet)) {
  120.             $this->adherentProjets->add($adherentProjet);
  121.             $adherentProjet->setChorale($this);
  122.         }
  123.         return $this;
  124.     }
  125.     public function removeAdherentProjet(AdherentProjets $adherentProjet): static
  126.     {
  127.         if ($this->adherentProjets->removeElement($adherentProjet)) {
  128.             // set the owning side to null (unless already changed)
  129.             if ($adherentProjet->getChorale() === $this) {
  130.                 $adherentProjet->setChorale(null);
  131.             }
  132.         }
  133.         return $this;
  134.     }
  135.     public function __toString() {
  136.         return $this->libelle;
  137.     }
  138.     /**
  139.      * @return Collection<int, ConfigurationDonReconnaissance>
  140.      */
  141.     public function getConfigurationDonReconnaissances(): Collection
  142.     {
  143.         return $this->configurationDonReconnaissances;
  144.     }
  145.     public function addConfigurationDonReconnaissance(ConfigurationDonReconnaissance $configurationDonReconnaissance): static
  146.     {
  147.         if (!$this->configurationDonReconnaissances->contains($configurationDonReconnaissance)) {
  148.             $this->configurationDonReconnaissances->add($configurationDonReconnaissance);
  149.             $configurationDonReconnaissance->setChorale($this);
  150.         }
  151.         return $this;
  152.     }
  153.     public function removeConfigurationDonReconnaissance(ConfigurationDonReconnaissance $configurationDonReconnaissance): static
  154.     {
  155.         if ($this->configurationDonReconnaissances->removeElement($configurationDonReconnaissance)) {
  156.             // set the owning side to null (unless already changed)
  157.             if ($configurationDonReconnaissance->getChorale() === $this) {
  158.                 $configurationDonReconnaissance->setChorale(null);
  159.             }
  160.         }
  161.         return $this;
  162.     }
  163. }