src/Entity/UserPasswordHistory.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity]
  6. #[ORM\Table('user_password_history')]
  7. class UserPasswordHistory
  8. {
  9. #[ORM\Id]
  10. #[ORM\GeneratedValue]
  11. #[ORM\Column]
  12. private ?int $id = null;
  13. #[ORM\ManyToOne(inversedBy: 'passwordHistory')]
  14. #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
  15. private ?User $user = null;
  16. #[ORM\Column(type: Types::STRING, length: 255)]
  17. private string $passwordHash;
  18. #[ORM\Column(type: Types::DATETIME_MUTABLE)]
  19. private \DateTimeInterface $createdAt;
  20. public function getId(): ?int
  21. {
  22. return $this->id;
  23. }
  24. public function getUser(): ?User
  25. {
  26. return $this->user;
  27. }
  28. public function setUser(User $user): static
  29. {
  30. $this->user = $user;
  31. return $this;
  32. }
  33. public function getPasswordHash(): string
  34. {
  35. return $this->passwordHash;
  36. }
  37. public function setPasswordHash(string $passwordHash): static
  38. {
  39. $this->passwordHash = $passwordHash;
  40. return $this;
  41. }
  42. public function getCreatedAt(): \DateTimeInterface
  43. {
  44. return $this->createdAt;
  45. }
  46. public function setCreatedAt(\DateTimeInterface $createdAt): static
  47. {
  48. $this->createdAt = $createdAt;
  49. return $this;
  50. }
  51. }