src/Entity/ResetPasswordRequest.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ResetPasswordRequestRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordRequestInterface;
  6. use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordRequestTrait;
  7. #[ORM\Entity(repositoryClass: ResetPasswordRequestRepository::class)]
  8. class ResetPasswordRequest implements ResetPasswordRequestInterface
  9. {
  10.     use ResetPasswordRequestTrait;
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type: 'integer')]
  14.     private ?int $id = null;
  15.     public function __construct(
  16.         #[ORM\ManyToOne(targetEntity: User::class)]
  17.         #[ORM\JoinColumn(nullable: false)]
  18.         private readonly User $user,
  19.         \DateTimeInterface $expiresAt,
  20.         string $selector,
  21.         string $hashedToken,
  22.     ) {
  23.         $this->initialize($expiresAt, $selector, $hashedToken);
  24.     }
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getUser(): object
  30.     {
  31.         return $this->user;
  32.     }
  33. }