src/Entity/PasswordHistory.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use DateTimeImmutable;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\PasswordHistoryRepository;
  6. #[ORM\Entity(repositoryClassPasswordHistoryRepository::class)]
  7. class PasswordHistory
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne(inversedBy'passwordHistories')]
  14.     #[ORM\JoinColumn(nullablefalse)]
  15.     private ?User $user null;
  16.     #[ORM\Column]
  17.     private ?\DateTimeImmutable $date null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $password null;
  20.     public function __construct()
  21.     {
  22.         $this->date = new DateTimeImmutable();
  23.     }
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getUser(): ?User
  29.     {
  30.         return $this->user;
  31.     }
  32.     public function setUser(?User $user): self
  33.     {
  34.         $this->user $user;
  35.         return $this;
  36.     }
  37.     public function getDate(): ?\DateTimeImmutable
  38.     {
  39.         return $this->date;
  40.     }
  41.     public function setDate(\DateTimeImmutable $date): self
  42.     {
  43.         $this->date $date;
  44.         return $this;
  45.     }
  46.     public function getPassword(): ?string
  47.     {
  48.         return $this->password;
  49.     }
  50.     public function setPassword(string $password): self
  51.     {
  52.         $this->password $password;
  53.         return $this;
  54.     }
  55. }