<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: \App\Repository\LoginAttemptRepository::class)]
class LoginAttempt
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;
#[ORM\Column(type: 'datetime_immutable', nullable: true)]
private mixed $date;
public function __construct(#[ORM\Column(type: 'string', length: 50, nullable: true)] private ?string $ipAddress, #[ORM\Column(type: 'string', length: 255, nullable: true)] private ?string $username)
{
$this->date = new \DateTimeImmutable('now');
}
public function getId(): ?int
{
return $this->id;
}
public function getIpAddress(): ?string
{
return $this->ipAddress;
}
public function setIpAddress(?string $ipAddress): self
{
$this->ipAddress = $ipAddress;
return $this;
}
public function getDate(): ?\DateTimeImmutable
{
return $this->date;
}
public function setDate(?\DateTimeImmutable $date): self
{
$this->date = $date;
return $this;
}
public function getUsername(): ?string
{
return $this->username;
}
public function setUsername(?string $username): self
{
$this->username = $username;
return $this;
}
}