src/Entity/FactureCandidat.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FactureCandidatRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. #[ORM\Entity(repositoryClassFactureCandidatRepository::class)]
  10. class FactureCandidat
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  17.     private ?\DateTimeInterface $date null;
  18.     #[ORM\ManyToOne(inversedBy'factureCandidats')]
  19.     #[Assert\NotBlank (message:"Le champ ne peut pas ĂȘtre vide.")]
  20.     private ?Inscription $inscription null;
  21.     #[ORM\Column(nullabletrue)]
  22.     private ?float $montant null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $devise null;
  25.     #[ORM\Column(nullabletrue)]
  26.     #[Assert\NotBlank (message:"Le champ ne peut pas ĂȘtre vide.")]
  27.     private ?int $etatPaiement null;
  28.     #[ORM\OneToMany(mappedBy'facture'targetEntityPaiementCandidat::class, cascade: ["persist","remove"])]
  29.     private Collection $paiementCandidats;
  30.     public function __construct()
  31.     {
  32.         $this->paiementCandidats = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function __toString()
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getDate(): ?\DateTimeInterface
  43.     {
  44.         return $this->date;
  45.     }
  46.     public function setDate(?\DateTimeInterface $date): self
  47.     {
  48.         $this->date $date;
  49.         return $this;
  50.     }
  51.     public function getInscription(): ?Inscription
  52.     {
  53.         return $this->inscription;
  54.     }
  55.     public function setInscription(?Inscription $inscription): self
  56.     {
  57.         $this->inscription $inscription;
  58.         return $this;
  59.     }
  60.     public function getMontant(): ?float
  61.     {
  62.         return $this->montant;
  63.     }
  64.     public function setMontant(?float $montant): self
  65.     {
  66.         $this->montant $montant;
  67.         return $this;
  68.     }
  69.     public function getEtatPaiement(): ?int
  70.     {
  71.         return $this->etatPaiement;
  72.     }
  73.     public function setEtatPaiement(?int $etatPaiement): self
  74.     {
  75.         $this->etatPaiement $etatPaiement;
  76.         return $this;
  77.     }
  78.     public function getDevise(): ?string
  79.     {
  80.         return $this->devise;
  81.     }
  82.     public function setDevise(?string $devise): static
  83.     {
  84.         $this->devise $devise;
  85.         return $this;
  86.     }
  87.     /**
  88.      * @return Collection<int, PaiementCandidat>
  89.      */
  90.     public function getPaiementCandidats(): Collection
  91.     {
  92.         return $this->paiementCandidats;
  93.     }
  94.     public function addPaiementCandidat(PaiementCandidat $paiementCandidat): static
  95.     {
  96.         if (!$this->paiementCandidats->contains($paiementCandidat)) {
  97.             $this->paiementCandidats->add($paiementCandidat);
  98.             $paiementCandidat->setFacture($this);
  99.         }
  100.         return $this;
  101.     }
  102.     public function removePaiementCandidat(PaiementCandidat $paiementCandidat): static
  103.     {
  104.         if ($this->paiementCandidats->removeElement($paiementCandidat)) {
  105.             // set the owning side to null (unless already changed)
  106.             if ($paiementCandidat->getFacture() === $this) {
  107.                 $paiementCandidat->setFacture(null);
  108.             }
  109.         }
  110.         return $this;
  111.     }
  112. }