<?phpnamespace App\Entity;use App\Repository\FactureCandidatRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: FactureCandidatRepository::class)]class FactureCandidat{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $date = null; #[ORM\ManyToOne(inversedBy: 'factureCandidats')] #[Assert\NotBlank (message:"Le champ ne peut pas ĂȘtre vide.")] private ?Inscription $inscription = null; #[ORM\Column(nullable: true)] private ?float $montant = null; #[ORM\Column(length: 255, nullable: true)] private ?string $devise = null; #[ORM\Column(nullable: true)] #[Assert\NotBlank (message:"Le champ ne peut pas ĂȘtre vide.")] private ?int $etatPaiement = null; #[ORM\OneToMany(mappedBy: 'facture', targetEntity: PaiementCandidat::class, cascade: ["persist","remove"])] private Collection $paiementCandidats; public function __construct() { $this->paiementCandidats = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function __toString() { return $this->id; } public function getDate(): ?\DateTimeInterface { return $this->date; } public function setDate(?\DateTimeInterface $date): self { $this->date = $date; return $this; } public function getInscription(): ?Inscription { return $this->inscription; } public function setInscription(?Inscription $inscription): self { $this->inscription = $inscription; return $this; } public function getMontant(): ?float { return $this->montant; } public function setMontant(?float $montant): self { $this->montant = $montant; return $this; } public function getEtatPaiement(): ?int { return $this->etatPaiement; } public function setEtatPaiement(?int $etatPaiement): self { $this->etatPaiement = $etatPaiement; return $this; } public function getDevise(): ?string { return $this->devise; } public function setDevise(?string $devise): static { $this->devise = $devise; return $this; } /** * @return Collection<int, PaiementCandidat> */ public function getPaiementCandidats(): Collection { return $this->paiementCandidats; } public function addPaiementCandidat(PaiementCandidat $paiementCandidat): static { if (!$this->paiementCandidats->contains($paiementCandidat)) { $this->paiementCandidats->add($paiementCandidat); $paiementCandidat->setFacture($this); } return $this; } public function removePaiementCandidat(PaiementCandidat $paiementCandidat): static { if ($this->paiementCandidats->removeElement($paiementCandidat)) { // set the owning side to null (unless already changed) if ($paiementCandidat->getFacture() === $this) { $paiementCandidat->setFacture(null); } } return $this; }}