1 | <?php |
||
18 | class PasswordRequest implements PasswordRequestInterface |
||
19 | { |
||
20 | /** |
||
21 | * @ORM\Id |
||
22 | * @ORM\Column(type="uuid", unique=true) |
||
23 | * |
||
24 | * @var \Ramsey\Uuid\UuidInterface |
||
25 | */ |
||
26 | private $id; |
||
27 | |||
28 | /** |
||
29 | * @ORM\Column(type="string", length=15) |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | private $status; |
||
34 | |||
35 | /** |
||
36 | * @ORM\Column(type="datetime") |
||
37 | * |
||
38 | * @var \DateTime |
||
39 | */ |
||
40 | private $created; |
||
41 | |||
42 | /** |
||
43 | * @ORM\Column(type="datetime") |
||
44 | * |
||
45 | * @var \DateTime |
||
46 | */ |
||
47 | private $updated; |
||
48 | |||
49 | /** |
||
50 | * @ORM\ManyToOne(targetEntity="UserInterface") |
||
51 | * @ORM\JoinColumn(onDelete="CASCADE") |
||
52 | * |
||
53 | * @var \SixtyEightPublishers\User\ForgotPassword\Entity\UserInterface |
||
54 | */ |
||
55 | private $user; |
||
56 | |||
57 | /** |
||
58 | * @ORM\Embedded(class="DeviceInfo", columnPrefix="request_") |
||
59 | * |
||
60 | * @var \SixtyEightPublishers\User\ForgotPassword\Entity\DeviceInfo |
||
61 | */ |
||
62 | private $requestDeviceInfo; |
||
63 | |||
64 | /** |
||
65 | * @ORM\Embedded(class="DeviceInfo", columnPrefix="reset_") |
||
66 | * |
||
67 | * @var \SixtyEightPublishers\User\ForgotPassword\Entity\DeviceInfo |
||
68 | */ |
||
69 | private $resetDeviceInfo; |
||
70 | |||
71 | /** @var string */ |
||
72 | private static $expiration = self::DEFAULT_EXPIRATION; |
||
73 | |||
74 | /** |
||
75 | * @param \SixtyEightPublishers\User\ForgotPassword\Entity\UserInterface $user |
||
76 | * |
||
77 | * @throws \Exception |
||
78 | */ |
||
79 | public function __construct(UserInterface $user) |
||
89 | |||
90 | /** |
||
91 | * @internal |
||
92 | * @ORM\PreUpdate |
||
93 | * |
||
94 | * @return void |
||
95 | * @throws \Exception |
||
96 | */ |
||
97 | public function onPreUpdate(): void |
||
101 | |||
102 | /** |
||
103 | * @param string $expiration |
||
104 | * |
||
105 | * @return void |
||
106 | */ |
||
107 | public static function setExpirationString(string $expiration): void |
||
111 | |||
112 | /** |
||
113 | * @return \Ramsey\Uuid\UuidInterface |
||
114 | */ |
||
115 | public function getId(): UuidInterface |
||
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | public function getStatus(): string |
||
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | public function setStatus(string $status): void |
||
143 | |||
144 | /** |
||
145 | * {@inheritdoc} |
||
146 | */ |
||
147 | public function getCreated(): DateTime |
||
151 | |||
152 | /** |
||
153 | * {@inheritdoc} |
||
154 | */ |
||
155 | public function getUpdated(): DateTime |
||
159 | |||
160 | /** |
||
161 | * {@inheritdoc} |
||
162 | */ |
||
163 | public function getUser(): UserInterface |
||
167 | |||
168 | /** |
||
169 | * {@inheritdoc} |
||
170 | */ |
||
171 | public function getExpiration(): DateTime |
||
175 | |||
176 | /** |
||
177 | * {@inheritdoc} |
||
178 | * |
||
179 | * @throws \Exception |
||
180 | */ |
||
181 | public function isExpired(): bool |
||
185 | |||
186 | /** |
||
187 | * {@inheritdoc} |
||
188 | */ |
||
189 | public function getRequestDeviceInfo(): DeviceInfo |
||
193 | |||
194 | /** |
||
195 | * {@inheritdoc} |
||
196 | */ |
||
197 | public function getResetDeviceInfo(): DeviceInfo |
||
201 | } |
||
202 |