src/Entity/LoginAttempt.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LoginAttemptRepository;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassLoginAttemptRepository::class)]
  7. class LoginAttempt
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne]
  14.     #[ORM\JoinColumn(nullablefalse)]
  15.     private ?User $user null;
  16.     #[ORM\Column(nullablefalse)]
  17.     private DateTime $createdAt;
  18.     public function __construct()
  19.     {
  20.         $this->createdAt = new DateTime();
  21.     }
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getUser(): ?User
  27.     {
  28.         return $this->user;
  29.     }
  30.     public function setUser(?User $user): self
  31.     {
  32.         $this->user $user;
  33.         return $this;
  34.     }
  35.     /**
  36.      * @return DateTime
  37.      */
  38.     public function getCreatedAt(): DateTime
  39.     {
  40.         return $this->createdAt;
  41.     }
  42. }