src/Entity/Financier.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FinancierRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. #[ORM\Entity(repositoryClassFinancierRepository::class)]
  7. #[UniqueEntity(fields: ['email'], message'Il existe déjà un compte avec cette email')]
  8. class Financier
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255nullabletrue)]
  15.     private ?string $name null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $email null;
  18.     public function getId(): ?int
  19.     {
  20.         return $this->id;
  21.     }
  22.     public function getName(): ?string
  23.     {
  24.         return $this->name;
  25.     }
  26.     public function setName(?string $name): static
  27.     {
  28.         $this->name $name;
  29.         return $this;
  30.     }
  31.     public function getEmail(): ?string
  32.     {
  33.         return $this->email;
  34.     }
  35.     public function setEmail(string $email): static
  36.     {
  37.         $this->email $email;
  38.         return $this;
  39.     }
  40. }