src/Entity/ResetPasswordRequest.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordRequestInterface;
  4. use App\Repository\ResetPasswordRequestRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=ResetPasswordRequestRepository::class)
  8.  */
  9. class ResetPasswordRequest implements ResetPasswordRequestInterface
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private ?int $id null;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  19.      * @ORM\JoinColumn(nullable=false)
  20.      */
  21.     private ?User $user null;
  22.     /**
  23.      * @ORM\Column(type="datetime")
  24.      */
  25.     private $expiresAt null;
  26.     /**
  27.      * @ORM\Column(type="datetime")
  28.      */
  29.     private $requestedAt null;
  30.     /**
  31.      * @ORM\Column(type="string", length=20)
  32.      */
  33.     private ?string $selector null;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private ?string $hashedToken null;
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getUser(): object
  43.     {
  44.         return $this->user;
  45.     }
  46.     public function setUser(?User $user): self
  47.     {
  48.         $this->user $user;
  49.         return $this;
  50.     }
  51.     public function getExpiresAt(): \DateTimeInterface
  52.     {
  53.         return $this->expiresAt;
  54.     }
  55.     public function setExpiresAt(?\DateTimeInterface $expiresAt): self
  56.     {
  57.         $this->expiresAt $expiresAt;
  58.         return $this;
  59.     }
  60.     public function getRequestedAt(): \DateTimeInterface
  61.     {
  62.         return $this->requestedAt;
  63.     }
  64.     public function setRequestedAt(?\DateTimeInterface $requestedAt): self
  65.     {
  66.         $this->requestedAt $requestedAt;
  67.         return $this;
  68.     }
  69.     public function getSelector(): ?string
  70.     {
  71.         return $this->selector;
  72.     }
  73.     public function setSelector(string $selector): self
  74.     {
  75.         $this->selector $selector;
  76.         return $this;
  77.     }
  78.     public function getHashedToken(): string
  79.     {
  80.         return $this->hashedToken;
  81.     }
  82.     public function setHashedToken(string $hashedToken): self
  83.     {
  84.         $this->hashedToken $hashedToken;
  85.         return $this;
  86.     }
  87.     public function isExpired(): bool
  88.     {
  89.         return $this->expiresAt < new \DateTime();
  90.     }
  91. }