src/Entity/Newsletters.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NewslettersRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. #[ORM\Entity(repositoryClass: NewslettersRepository::class)]
  7. class Newsletters
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id;
  13.     #[ORM\Column(type: "string",length: 225)]
  14.     private ?string $email;
  15.     
  16.     #[ORM\Column]
  17.     private ?\DateTimeImmutable $created_at = null;
  18.     #[ORM\Column]
  19.     private ?\DateTimeImmutable $updated_at = null;
  20.     public function __construct(){
  21.         $this->note = 0;
  22.         $this->created_at = new \DateTimeImmutable();
  23.         $this->updated_at = new \DateTimeImmutable();
  24.     }
  25.     public function getId(): ?int
  26.     { return $this->id; }
  27.     public function getEmail(): ?string
  28.     { return $this->email; }
  29.     public function setEmail(string $email): self
  30.     { $this->email = $email;
  31.       return $this;
  32.     }
  33.     public function getCreatedAt(): ?\DateTimeImmutable
  34.     { return $this->created_at; }
  35.     public function setCreatedAt(\DateTimeImmutable $created_at): static
  36.     { $this->created_at = $created_at;
  37.       return $this;
  38.     }
  39.     public function getUpdatedAt(): ?\DateTimeImmutable
  40.     { return $this->updated_at; }
  41.     public function UpdatedAt(\DateTimeImmutable $updated_at): static
  42.     { $this->updated_at = $updated_at;
  43.       return $this;
  44.     }
  45. }