| @@ 7-54 (lines=48) @@ | ||
| 4 | ||
| 5 | use HMLB\DDD\Entity\Identity; |
|
| 6 | ||
| 7 | final class PasswordChanged extends UserEvent |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * @var Identity |
|
| 11 | */ |
|
| 12 | private $userId; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @var string |
|
| 16 | */ |
|
| 17 | private $oldPassword; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @var string |
|
| 21 | */ |
|
| 22 | private $newPassword; |
|
| 23 | ||
| 24 | public function __construct(Identity $userId, string $oldPassword, string $newPassword) |
|
| 25 | { |
|
| 26 | $this->userId = $userId; |
|
| 27 | $this->oldPassword = $oldPassword; |
|
| 28 | $this->newPassword = $newPassword; |
|
| 29 | } |
|
| 30 | ||
| 31 | /** |
|
| 32 | * @return string |
|
| 33 | */ |
|
| 34 | public function getOldPassword(): string |
|
| 35 | { |
|
| 36 | return $this->oldPassword; |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * @return string |
|
| 41 | */ |
|
| 42 | public function getNewPassword(): string |
|
| 43 | { |
|
| 44 | return $this->newPassword; |
|
| 45 | } |
|
| 46 | ||
| 47 | /** |
|
| 48 | * @return Identity |
|
| 49 | */ |
|
| 50 | public function getUserId(): Identity |
|
| 51 | { |
|
| 52 | return $this->userId; |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||
| @@ 13-60 (lines=48) @@ | ||
| 10 | * |
|
| 11 | * @author Hugues Maignol <[email protected]> |
|
| 12 | */ |
|
| 13 | final class PasswordReset extends UserEvent |
|
| 14 | { |
|
| 15 | /** |
|
| 16 | * @var Identity |
|
| 17 | */ |
|
| 18 | private $userId; |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @var string |
|
| 22 | */ |
|
| 23 | private $oldPassword; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @var string |
|
| 27 | */ |
|
| 28 | private $newPassword; |
|
| 29 | ||
| 30 | public function __construct(Identity $userId, string $oldPassword, string $newPassword) |
|
| 31 | { |
|
| 32 | $this->userId = $userId; |
|
| 33 | $this->oldPassword = $oldPassword; |
|
| 34 | $this->newPassword = $newPassword; |
|
| 35 | } |
|
| 36 | ||
| 37 | /** |
|
| 38 | * @return string |
|
| 39 | */ |
|
| 40 | public function getOldPassword(): string |
|
| 41 | { |
|
| 42 | return $this->oldPassword; |
|
| 43 | } |
|
| 44 | ||
| 45 | /** |
|
| 46 | * @return string |
|
| 47 | */ |
|
| 48 | public function getNewPassword(): string |
|
| 49 | { |
|
| 50 | return $this->newPassword; |
|
| 51 | } |
|
| 52 | ||
| 53 | /** |
|
| 54 | * @return Identity |
|
| 55 | */ |
|
| 56 | public function getUserId(): Identity |
|
| 57 | { |
|
| 58 | return $this->userId; |
|
| 59 | } |
|
| 60 | } |
|
| 61 | ||