<?php
namespace App\Entity;
use App\Repository\UserLoginHistoryRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Security\Core\User\UserInterface;
#[ORM\Entity(repositoryClass: UserLoginHistoryRepository::class), ORM\Table(name: 'user_login_history')]
class UserLoginHistory
{
#[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'loginHistory'), ORM\JoinColumn(nullable: false)]
private $user;
#[ORM\Column(type: 'string', length: 50)]
private $userIp;
#[ORM\Column(type: 'string', length: 100)]
private $fileUrl;
#[ORM\Column(type: 'integer', length: 11)]
private $loginAttempts;
#[Gedmo\Timestampable(on: 'create'), ORM\Column(type: 'datetime')]
private $loggedInAt;
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?UserInterface
{
return $this->user;
}
public function setUser(?UserInterface $user): self
{
$this->user = $user;
return $this;
}
public function getUserIp(): ?string
{
return $this->userIp;
}
public function setUserIp(string $userIp): self
{
$this->userIp = $userIp;
return $this;
}
public function getLoggedInAt(): ?\DateTimeInterface
{
return $this->loggedInAt;
}
public function getloginAttempts(): ?int
{
return $this->loginAttempts;
}
public function setLoginAttempts(int $loginAttempts): self
{
$this->loginAttempts = $loginAttempts;
return $this;
}
public function getFileUrl(): ?string
{
return $this->fileUrl;
}
public function setFileUrl(string $fileUrl): self
{
$this->fileUrl = $fileUrl;
return $this;
}
}