src/Entity/MoyPaiement.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MoyPaiementRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * @ORM\Entity(repositoryClass=MoyPaiementRepository::class)
  11.  * @UniqueEntity(fields={"wording"},message="Ce libelle est déjà utilisé." )
  12.  */
  13. class MoyPaiement
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $wording;
  25.     /**
  26.      * @ORM\OneToMany(targetEntity=Reglement::class, mappedBy="modpaiement")
  27.      */
  28.     private $reglements;
  29.     /**
  30.      * @ORM\OneToMany(targetEntity=ReglementParticulier::class, mappedBy="modpaiement")
  31.      */
  32.     private $reglementParticuliers;
  33.     public function __construct()
  34.     {
  35.         $this->reglements = new ArrayCollection();
  36.         $this->reglementParticuliers = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getWording(): ?string
  43.     {
  44.         return $this->wording;
  45.     }
  46.     public function setWording(string $wording): self
  47.     {
  48.         $this->wording $wording;
  49.         return $this;
  50.     }
  51.     /**
  52.      * @return Collection<int, Reglement>
  53.      */
  54.     public function getReglements(): Collection
  55.     {
  56.         return $this->reglements;
  57.     }
  58.     public function addReglement(Reglement $reglement): self
  59.     {
  60.         if (!$this->reglements->contains($reglement)) {
  61.             $this->reglements[] = $reglement;
  62.             $reglement->setModpaiement($this);
  63.         }
  64.         return $this;
  65.     }
  66.     public function removeReglement(Reglement $reglement): self
  67.     {
  68.         if ($this->reglements->removeElement($reglement)) {
  69.             // set the owning side to null (unless already changed)
  70.             if ($reglement->getModpaiement() === $this) {
  71.                 $reglement->setModpaiement(null);
  72.             }
  73.         }
  74.         return $this;
  75.     }
  76.     /**
  77.      * @return Collection<int, ReglementParticulier>
  78.      */
  79.     public function getReglementParticuliers(): Collection
  80.     {
  81.         return $this->reglementParticuliers;
  82.     }
  83.     public function addReglementParticulier(ReglementParticulier $reglementParticulier): self
  84.     {
  85.         if (!$this->reglementParticuliers->contains($reglementParticulier)) {
  86.             $this->reglementParticuliers[] = $reglementParticulier;
  87.             $reglementParticulier->setModpaiement($this);
  88.         }
  89.         return $this;
  90.     }
  91.     public function removeReglementParticulier(ReglementParticulier $reglementParticulier): self
  92.     {
  93.         if ($this->reglementParticuliers->removeElement($reglementParticulier)) {
  94.             // set the owning side to null (unless already changed)
  95.             if ($reglementParticulier->getModpaiement() === $this) {
  96.                 $reglementParticulier->setModpaiement(null);
  97.             }
  98.         }
  99.         return $this;
  100.     }
  101. }