src/Entity/LoginHistory.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\App\LoginHistoryRepository")
  6.  */
  7. class LoginHistory
  8. {
  9.     /**
  10.      * @ORM\Id
  11.      * @ORM\GeneratedValue
  12.      * @ORM\Column(type="integer")
  13.      */
  14.     private $id;
  15.     /**
  16.      * @ORM\Column(type="datetime_immutable")
  17.      */
  18.     private $date;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  21.      * @ORM\JoinColumn(nullable=false, name="customer_user")
  22.      */
  23.     private $user;
  24.     public function __construct(User $user)
  25.     {
  26.         $this->date = new \DateTimeImmutable();
  27.         $this->user $user;
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getDate(): \DateTimeInterface
  34.     {
  35.         return $this->date;
  36.     }
  37.     public function setDate(\DateTimeInterface $date): self
  38.     {
  39.         $this->date $date;
  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. }