<?phpnamespace App\Entity;use App\Repository\MoyPaiementRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Entity(repositoryClass=MoyPaiementRepository::class) * @UniqueEntity(fields={"wording"},message="Ce libelle est déjà utilisé." ) */class MoyPaiement{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $wording; /** * @ORM\OneToMany(targetEntity=Reglement::class, mappedBy="modpaiement") */ private $reglements; /** * @ORM\OneToMany(targetEntity=ReglementParticulier::class, mappedBy="modpaiement") */ private $reglementParticuliers; public function __construct() { $this->reglements = new ArrayCollection(); $this->reglementParticuliers = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getWording(): ?string { return $this->wording; } public function setWording(string $wording): self { $this->wording = $wording; return $this; } /** * @return Collection<int, Reglement> */ public function getReglements(): Collection { return $this->reglements; } public function addReglement(Reglement $reglement): self { if (!$this->reglements->contains($reglement)) { $this->reglements[] = $reglement; $reglement->setModpaiement($this); } return $this; } public function removeReglement(Reglement $reglement): self { if ($this->reglements->removeElement($reglement)) { // set the owning side to null (unless already changed) if ($reglement->getModpaiement() === $this) { $reglement->setModpaiement(null); } } return $this; } /** * @return Collection<int, ReglementParticulier> */ public function getReglementParticuliers(): Collection { return $this->reglementParticuliers; } public function addReglementParticulier(ReglementParticulier $reglementParticulier): self { if (!$this->reglementParticuliers->contains($reglementParticulier)) { $this->reglementParticuliers[] = $reglementParticulier; $reglementParticulier->setModpaiement($this); } return $this; } public function removeReglementParticulier(ReglementParticulier $reglementParticulier): self { if ($this->reglementParticuliers->removeElement($reglementParticulier)) { // set the owning side to null (unless already changed) if ($reglementParticulier->getModpaiement() === $this) { $reglementParticulier->setModpaiement(null); } } return $this; }}