src/Entity/LoginHistory.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LoginHistoryRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=LoginHistoryRepository::class)
  7.  */
  8. class LoginHistory
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="datetime")
  18.      */
  19.     private $createdAt;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="loginHistories")
  22.      * @ORM\JoinColumn(nullable=false)
  23.      */
  24.     private $user;
  25.     /**
  26.      * @ORM\Column(type="string", length=100, nullable=true)
  27.      */
  28.     private $ip;
  29.     public function __construct()
  30.     {
  31.         $this->createdAt = new \DateTime();
  32.     }
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getCreatedAt(): ?\DateTimeInterface
  38.     {
  39.         return $this->createdAt;
  40.     }
  41.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  42.     {
  43.         $this->createdAt $createdAt;
  44.         return $this;
  45.     }
  46.     public function getUser(): ?User
  47.     {
  48.         return $this->user;
  49.     }
  50.     public function setUser(?User $user): self
  51.     {
  52.         $this->user $user;
  53.         return $this;
  54.     }
  55.     public function getIp(): ?string
  56.     {
  57.         return $this->ip;
  58.     }
  59.     public function setIp(?string $ip): self
  60.     {
  61.         $this->ip $ip;
  62.         return $this;
  63.     }
  64. }