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.     public function __construct()
  26.     {
  27.         $this->createdAt = new \DateTime();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getCreatedAt(): ?\DateTimeInterface
  34.     {
  35.         return $this->createdAt;
  36.     }
  37.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  38.     {
  39.         $this->createdAt $createdAt;
  40.         return $this;
  41.     }
  42.     public function getUser(): ?User
  43.     {
  44.         return $this->user;
  45.     }
  46.     public function setUser(?User $user): self
  47.     {
  48.         $this->user $user;
  49.         return $this;
  50.     }
  51. }