src/Domain/Merchant/Model/MerchantResetPasswordToken.php line 10

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Domain\Merchant\Model;
  4. use App\Domain\Shared\Model\TimestampTrait;
  5. use Symfony\Component\Uid\Uuid;
  6. class MerchantResetPasswordToken
  7. {
  8.     use TimestampTrait;
  9.     public function __construct(
  10.         private readonly Uuid $id,
  11.         private readonly Merchant $merchant,
  12.         private readonly \DateTimeImmutable $expiryDate,
  13.         private readonly string $token,
  14.         private bool $used false
  15.     ) {
  16.         $this->createdAt = new \DateTimeImmutable();
  17.     }
  18.     public function getExpiryDate(): \DateTimeImmutable
  19.     {
  20.         return $this->expiryDate;
  21.     }
  22.     public function getMerchant(): Merchant
  23.     {
  24.         return $this->merchant;
  25.     }
  26.     public function getToken(): string
  27.     {
  28.         return $this->token;
  29.     }
  30.     public function isUsed(): bool
  31.     {
  32.         return $this->used;
  33.     }
  34.     public function isExpired(): bool
  35.     {
  36.         return $this->expiryDate < new \DateTimeImmutable();
  37.     }
  38.     public function setUsed(bool $used): void
  39.     {
  40.         $this->used $used;
  41.     }
  42. }