src/Entity/ProjetBailleur.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjetBailleurRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. #[ORM\Entity(repositoryClass: ProjetBailleurRepository::class)]
  9. class ProjetBailleur
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     #[Groups(["projetBailleur:read"])]
  15.     private ?int $id = null;
  16.     #[ORM\Column(type: Types::DATE_MUTABLE)]
  17.     #[Assert\NotBlank(message:"Veuillez remplir ce champ")]
  18.     #[Groups(["projetBailleur:read"])]
  19.     private ?\DateTimeInterface $createdAt = null;
  20.     #[ORM\ManyToOne(inversedBy: 'projetBailleurs')]
  21.     #[Groups(["projetBailleur:read"])]
  22.     private ?Projet $projet = null;
  23.     #[ORM\ManyToOne(inversedBy: 'projetBailleurs')]
  24.     #[Assert\NotBlank(message:"Veuillez remplir ce champ")]
  25.     #[Groups(["projetBailleur:read"])]
  26.     private ?Bailleur $bailleur = null;
  27.     #[ORM\Column]
  28.     #[Groups(["projetBailleur:read"])]
  29.     #[Assert\NotBlank(message:"Veuillez remplir ce champ")]
  30.     private ?float $montant = null;
  31.     #[ORM\Column]
  32.     #[Groups(["projetBailleur:read"])]
  33.     #[Assert\NotBlank(message:"Veuillez remplir ce champ")]
  34.     private ?float $contrubution = null;
  35.     #[ORM\ManyToOne(inversedBy: 'projetBailleurs')]
  36.     #[Assert\NotBlank(message:"Veuillez remplir ce champ")]
  37.     #[Groups(["projetBailleur:read"])]
  38.     private ?ModeFinance $modeFinance = null;
  39.     public function __construct() {
  40.         $this->createdAt = new \DateTimeImmutable();
  41.         $this->montant = 0;
  42.         $this->contrubution = 0;
  43.     }
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getCreatedAt(): ?\DateTimeInterface
  49.     {
  50.         return $this->createdAt;
  51.     }
  52.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  53.     {
  54.         $this->createdAt = $createdAt;
  55.         return $this;
  56.     }
  57.     public function getProjet(): ?Projet
  58.     {
  59.         return $this->projet;
  60.     }
  61.     public function setProjet(?Projet $projet): self
  62.     {
  63.         $this->projet = $projet;
  64.         return $this;
  65.     }
  66.     public function getBailleur(): ?Bailleur
  67.     {
  68.         return $this->bailleur;
  69.     }
  70.     public function setBailleur(?Bailleur $bailleur): self
  71.     {
  72.         $this->bailleur = $bailleur;
  73.         $this->bailleur->setIsDeleted(false);
  74.         return $this;
  75.     }
  76.     public function getMontant(): ?float
  77.     {
  78.         return $this->montant;
  79.     }
  80.     public function setMontant(?float $montant): self
  81.     {
  82.         $this->montant = $montant;
  83.         return $this;
  84.     }
  85.     public function getContrubution(): ?float
  86.     {
  87.         return $this->contrubution;
  88.     }
  89.     public function setContrubution(?float $contrubution): self
  90.     {
  91.         $this->contrubution = $contrubution;
  92.         return $this;
  93.     }
  94.     public function getModeFinance(): ?ModeFinance
  95.     {
  96.         return $this->modeFinance;
  97.     }
  98.     public function setModeFinance(?ModeFinance $modeFinance): self
  99.     {
  100.         $this->modeFinance = $modeFinance;
  101.         $this->modeFinance->setIsDeleted(false);
  102.         return $this;
  103.     }
  104. }