| @@ 24-83 (lines=60) @@ | ||
| 21 | * @author Beñat Espiña <[email protected]> |
|
| 22 | * @author Gorka Laucirica <[email protected]> |
|
| 23 | */ |
|
| 24 | final class UserEnabled implements UserEvent |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * The user id. |
|
| 28 | * |
|
| 29 | * @var UserId |
|
| 30 | */ |
|
| 31 | private $userId; |
|
| 32 | ||
| 33 | /** |
|
| 34 | * The email. |
|
| 35 | * |
|
| 36 | * @var UserEmail |
|
| 37 | */ |
|
| 38 | private $email; |
|
| 39 | ||
| 40 | /** |
|
| 41 | * The occurred on. |
|
| 42 | * |
|
| 43 | * @var \DateTimeImmutable |
|
| 44 | */ |
|
| 45 | private $occurredOn; |
|
| 46 | ||
| 47 | /** |
|
| 48 | * Constructor. |
|
| 49 | * |
|
| 50 | * @param UserId $aUserId The user id |
|
| 51 | * @param UserEmail $anEmail The email |
|
| 52 | */ |
|
| 53 | public function __construct(UserId $aUserId, UserEmail $anEmail) |
|
| 54 | { |
|
| 55 | $this->userId = $aUserId; |
|
| 56 | $this->email = $anEmail; |
|
| 57 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * {@inheritdoc} |
|
| 62 | */ |
|
| 63 | public function id() |
|
| 64 | { |
|
| 65 | return $this->userId; |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * {@inheritdoc} |
|
| 70 | */ |
|
| 71 | public function email() |
|
| 72 | { |
|
| 73 | return $this->email; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * {@inheritdoc} |
|
| 78 | */ |
|
| 79 | public function occurredOn() |
|
| 80 | { |
|
| 81 | return $this->occurredOn; |
|
| 82 | } |
|
| 83 | } |
|
| 84 | ||
| @@ 24-83 (lines=60) @@ | ||
| 21 | * @author Beñat Espiña <[email protected]> |
|
| 22 | * @author Gorka Laucirica <[email protected]> |
|
| 23 | */ |
|
| 24 | final class UserLoggedIn implements UserEvent |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * The user id. |
|
| 28 | * |
|
| 29 | * @var UserId |
|
| 30 | */ |
|
| 31 | private $userId; |
|
| 32 | ||
| 33 | /** |
|
| 34 | * The email. |
|
| 35 | * |
|
| 36 | * @var UserEmail |
|
| 37 | */ |
|
| 38 | private $email; |
|
| 39 | ||
| 40 | /** |
|
| 41 | * The occurred on. |
|
| 42 | * |
|
| 43 | * @var \DateTimeImmutable |
|
| 44 | */ |
|
| 45 | private $occurredOn; |
|
| 46 | ||
| 47 | /** |
|
| 48 | * Constructor. |
|
| 49 | * |
|
| 50 | * @param UserId $aUserId The user id |
|
| 51 | * @param UserEmail $anEmail The email |
|
| 52 | */ |
|
| 53 | public function __construct(UserId $aUserId, UserEmail $anEmail) |
|
| 54 | { |
|
| 55 | $this->userId = $aUserId; |
|
| 56 | $this->email = $anEmail; |
|
| 57 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * {@inheritdoc} |
|
| 62 | */ |
|
| 63 | public function id() |
|
| 64 | { |
|
| 65 | return $this->userId; |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * {@inheritdoc} |
|
| 70 | */ |
|
| 71 | public function email() |
|
| 72 | { |
|
| 73 | return $this->email; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * {@inheritdoc} |
|
| 78 | */ |
|
| 79 | public function occurredOn() |
|
| 80 | { |
|
| 81 | return $this->occurredOn; |
|
| 82 | } |
|
| 83 | } |
|
| 84 | ||
| @@ 24-83 (lines=60) @@ | ||
| 21 | * @author Beñat Espiña <[email protected]> |
|
| 22 | * @author Gorka Laucirica <[email protected]> |
|
| 23 | */ |
|
| 24 | final class UserLoggedOut implements UserEvent |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * The user id. |
|
| 28 | * |
|
| 29 | * @var UserId |
|
| 30 | */ |
|
| 31 | private $userId; |
|
| 32 | ||
| 33 | /** |
|
| 34 | * The email. |
|
| 35 | * |
|
| 36 | * @var UserEmail |
|
| 37 | */ |
|
| 38 | private $email; |
|
| 39 | ||
| 40 | /** |
|
| 41 | * The occurred on. |
|
| 42 | * |
|
| 43 | * @var \DateTimeImmutable |
|
| 44 | */ |
|
| 45 | private $occurredOn; |
|
| 46 | ||
| 47 | /** |
|
| 48 | * Constructor. |
|
| 49 | * |
|
| 50 | * @param UserId $aUserId The user id |
|
| 51 | * @param UserEmail $anEmail The email |
|
| 52 | */ |
|
| 53 | public function __construct(UserId $aUserId, UserEmail $anEmail) |
|
| 54 | { |
|
| 55 | $this->userId = $aUserId; |
|
| 56 | $this->email = $anEmail; |
|
| 57 | $this->occurredOn = new \DateTimeImmutable(); |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * {@inheritdoc} |
|
| 62 | */ |
|
| 63 | public function id() |
|
| 64 | { |
|
| 65 | return $this->userId; |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * {@inheritdoc} |
|
| 70 | */ |
|
| 71 | public function email() |
|
| 72 | { |
|
| 73 | return $this->email; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * {@inheritdoc} |
|
| 78 | */ |
|
| 79 | public function occurredOn() |
|
| 80 | { |
|
| 81 | return $this->occurredOn; |
|
| 82 | } |
|
| 83 | } |
|
| 84 | ||