src/Entity/LoginAttempt.php line 8

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. #[ORM\Entity(repositoryClass\App\Repository\LoginAttemptRepository::class)]
  5. class LoginAttempt
  6. {
  7.     #[ORM\Id]
  8.     #[ORM\GeneratedValue]
  9.     #[ORM\Column(type'integer')]
  10.     private ?int $id null;
  11.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  12.     private mixed $date;
  13.     public function __construct(#[ORM\Column(type'string'length50nullabletrue)] private ?string $ipAddress, #[ORM\Column(type'string'length255nullabletrue)] private ?string $username)
  14.     {
  15.         $this->date = new \DateTimeImmutable('now');
  16.     }
  17.     public function getId(): ?int
  18.     {
  19.         return $this->id;
  20.     }
  21.     public function getIpAddress(): ?string
  22.     {
  23.         return $this->ipAddress;
  24.     }
  25.     public function setIpAddress(?string $ipAddress): self
  26.     {
  27.         $this->ipAddress $ipAddress;
  28.         return $this;
  29.     }
  30.     public function getDate(): ?\DateTimeImmutable
  31.     {
  32.         return $this->date;
  33.     }
  34.     public function setDate(?\DateTimeImmutable $date): self
  35.     {
  36.         $this->date $date;
  37.         return $this;
  38.     }
  39.     public function getUsername(): ?string
  40.     {
  41.         return $this->username;
  42.     }
  43.     public function setUsername(?string $username): self
  44.     {
  45.         $this->username $username;
  46.         return $this;
  47.     }
  48. }