src/Entity/Newsletter.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\NewsletterRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassNewsletterRepository::class)]
  8. #[ApiResource]
  9. class Newsletter
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255uniquetrue)]
  16.     private ?string $email null;
  17.     #[ORM\Column]
  18.     private ?\DateTimeImmutable $createdAt null;
  19.     #[ORM\Column(length100nullabletrue)]
  20.     private ?string $firstname null;
  21.     #[ORM\Column(length100nullabletrue)]
  22.     private ?string $lastname null;
  23.     #[ORM\Column(length1nullabletrue)]
  24.     private ?string $gender null;
  25.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  26.     private ?\DateTimeInterface $bornAt null;
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getEmail(): ?string
  32.     {
  33.         return $this->email;
  34.     }
  35.     public function setEmail(string $email): self
  36.     {
  37.         $this->email $email;
  38.         return $this;
  39.     }
  40.     public function getCreatedAt(): ?\DateTimeImmutable
  41.     {
  42.         return $this->createdAt;
  43.     }
  44.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  45.     {
  46.         $this->createdAt $createdAt;
  47.         return $this;
  48.     }
  49.     public function getFirstname(): ?string
  50.     {
  51.         return $this->firstname;
  52.     }
  53.     public function setFirstname(?string $firstname): self
  54.     {
  55.         $this->firstname $firstname;
  56.         return $this;
  57.     }
  58.     public function getLastname(): ?string
  59.     {
  60.         return $this->lastname;
  61.     }
  62.     public function setLastname(?string $lastname): self
  63.     {
  64.         $this->lastname $lastname;
  65.         return $this;
  66.     }
  67.     public function getGender(): ?string
  68.     {
  69.         return $this->gender;
  70.     }
  71.     public function setGender(?string $gender): self
  72.     {
  73.         $this->gender $gender;
  74.         return $this;
  75.     }
  76.     public function getBornAt(): ?\DateTimeInterface
  77.     {
  78.         return $this->bornAt;
  79.     }
  80.     public function setBornAt(?\DateTimeInterface $bornAt): self
  81.     {
  82.         $this->bornAt $bornAt;
  83.         return $this;
  84.     }
  85. }