| @@ 23-108 (lines=86) @@ | ||
| 20 | * @author Beñat Espiña <[email protected]> |
|
| 21 | * @author Gorka Laucirica <[email protected]> |
|
| 22 | */ |
|
| 23 | class ByInvitationSignUpUserCommand |
|
| 24 | { |
|
| 25 | /** |
|
| 26 | * The user id. |
|
| 27 | * |
|
| 28 | * @var string |
|
| 29 | */ |
|
| 30 | private $id; |
|
| 31 | ||
| 32 | /** |
|
| 33 | * The invitation token. |
|
| 34 | * |
|
| 35 | * @var string |
|
| 36 | */ |
|
| 37 | private $invitationToken; |
|
| 38 | ||
| 39 | /** |
|
| 40 | * The plain password. |
|
| 41 | * |
|
| 42 | * @var string |
|
| 43 | */ |
|
| 44 | private $plainPassword; |
|
| 45 | ||
| 46 | /** |
|
| 47 | * Array which contains the roles. |
|
| 48 | * |
|
| 49 | * @var array |
|
| 50 | */ |
|
| 51 | private $roles; |
|
| 52 | ||
| 53 | /** |
|
| 54 | * Constructor. |
|
| 55 | * |
|
| 56 | * @param string $anInvitationToken The invitation token |
|
| 57 | * @param string $aPlainPassword The plain password |
|
| 58 | * @param array $roles Array which contains the roles |
|
| 59 | * @param string|null $anId User id, it can be null |
|
| 60 | */ |
|
| 61 | public function __construct($anInvitationToken, $aPlainPassword, array $roles, $anId = null) |
|
| 62 | { |
|
| 63 | $this->id = null === $anId ? Uuid::uuid4()->toString() : $anId; |
|
| 64 | $this->invitationToken = $anInvitationToken; |
|
| 65 | $this->plainPassword = $aPlainPassword; |
|
| 66 | $this->roles = $roles; |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * Gets the id. |
|
| 71 | * |
|
| 72 | * @return string |
|
| 73 | */ |
|
| 74 | public function id() |
|
| 75 | { |
|
| 76 | return $this->id; |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * Gets the invitation token. |
|
| 81 | * |
|
| 82 | * @return string |
|
| 83 | */ |
|
| 84 | public function invitationToken() |
|
| 85 | { |
|
| 86 | return $this->invitationToken; |
|
| 87 | } |
|
| 88 | ||
| 89 | /** |
|
| 90 | * Gets the user plain password. |
|
| 91 | * |
|
| 92 | * @return string |
|
| 93 | */ |
|
| 94 | public function password() |
|
| 95 | { |
|
| 96 | return $this->plainPassword; |
|
| 97 | } |
|
| 98 | ||
| 99 | /** |
|
| 100 | * Gets the roles. |
|
| 101 | * |
|
| 102 | * @return array |
|
| 103 | */ |
|
| 104 | public function roles() |
|
| 105 | { |
|
| 106 | return $this->roles; |
|
| 107 | } |
|
| 108 | } |
|
| 109 | ||
| @@ 23-108 (lines=86) @@ | ||
| 20 | * @author Beñat Espiña <[email protected]> |
|
| 21 | * @author Gorka Laucirica <[email protected]> |
|
| 22 | */ |
|
| 23 | class ByInvitationWithConfirmationSignUpUserCommand |
|
| 24 | { |
|
| 25 | /** |
|
| 26 | * The user id. |
|
| 27 | * |
|
| 28 | * @var string |
|
| 29 | */ |
|
| 30 | private $id; |
|
| 31 | ||
| 32 | /** |
|
| 33 | * The invitation token. |
|
| 34 | * |
|
| 35 | * @var string |
|
| 36 | */ |
|
| 37 | private $invitationToken; |
|
| 38 | ||
| 39 | /** |
|
| 40 | * The plain password. |
|
| 41 | * |
|
| 42 | * @var string |
|
| 43 | */ |
|
| 44 | private $plainPassword; |
|
| 45 | ||
| 46 | /** |
|
| 47 | * Array which contains the roles. |
|
| 48 | * |
|
| 49 | * @var array |
|
| 50 | */ |
|
| 51 | private $roles; |
|
| 52 | ||
| 53 | /** |
|
| 54 | * Constructor. |
|
| 55 | * |
|
| 56 | * @param string $anInvitationToken The invitation token |
|
| 57 | * @param string $aPlainPassword The plain password |
|
| 58 | * @param array $roles Array which contains the roles |
|
| 59 | * @param string|null $anId User id, it can be null |
|
| 60 | */ |
|
| 61 | public function __construct($anInvitationToken, $aPlainPassword, array $roles, $anId = null) |
|
| 62 | { |
|
| 63 | $this->id = null === $anId ? Uuid::uuid4()->toString() : $anId; |
|
| 64 | $this->invitationToken = $anInvitationToken; |
|
| 65 | $this->plainPassword = $aPlainPassword; |
|
| 66 | $this->roles = $roles; |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * Gets the id. |
|
| 71 | * |
|
| 72 | * @return string |
|
| 73 | */ |
|
| 74 | public function id() |
|
| 75 | { |
|
| 76 | return $this->id; |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * Gets the invitation token. |
|
| 81 | * |
|
| 82 | * @return string |
|
| 83 | */ |
|
| 84 | public function invitationToken() |
|
| 85 | { |
|
| 86 | return $this->invitationToken; |
|
| 87 | } |
|
| 88 | ||
| 89 | /** |
|
| 90 | * Gets the user plain password. |
|
| 91 | * |
|
| 92 | * @return string |
|
| 93 | */ |
|
| 94 | public function password() |
|
| 95 | { |
|
| 96 | return $this->plainPassword; |
|
| 97 | } |
|
| 98 | ||
| 99 | /** |
|
| 100 | * Gets the roles. |
|
| 101 | * |
|
| 102 | * @return array |
|
| 103 | */ |
|
| 104 | public function roles() |
|
| 105 | { |
|
| 106 | return $this->roles; |
|
| 107 | } |
|
| 108 | } |
|
| 109 | ||
| @@ 23-108 (lines=86) @@ | ||
| 20 | * @author Beñat Espiña <[email protected]> |
|
| 21 | * @author Gorka Laucirica <[email protected]> |
|
| 22 | */ |
|
| 23 | class SignUpUserCommand |
|
| 24 | { |
|
| 25 | /** |
|
| 26 | * The user id. |
|
| 27 | * |
|
| 28 | * @var string |
|
| 29 | */ |
|
| 30 | private $id; |
|
| 31 | ||
| 32 | /** |
|
| 33 | * The user email. |
|
| 34 | * |
|
| 35 | * @var string |
|
| 36 | */ |
|
| 37 | private $email; |
|
| 38 | ||
| 39 | /** |
|
| 40 | * The plain password. |
|
| 41 | * |
|
| 42 | * @var string |
|
| 43 | */ |
|
| 44 | private $plainPassword; |
|
| 45 | ||
| 46 | /** |
|
| 47 | * Array which contains the roles. |
|
| 48 | * |
|
| 49 | * @var array |
|
| 50 | */ |
|
| 51 | private $roles; |
|
| 52 | ||
| 53 | /** |
|
| 54 | * Constructor. |
|
| 55 | * |
|
| 56 | * @param string $anEmail The email |
|
| 57 | * @param string $aPlainPassword The plain password |
|
| 58 | * @param array $roles Array which contains the roles |
|
| 59 | * @param string|null $anId User id, it can be null |
|
| 60 | */ |
|
| 61 | public function __construct($anEmail, $aPlainPassword, array $roles, $anId = null) |
|
| 62 | { |
|
| 63 | $this->id = null === $anId ? Uuid::uuid4()->toString() : $anId; |
|
| 64 | $this->email = $anEmail; |
|
| 65 | $this->plainPassword = $aPlainPassword; |
|
| 66 | $this->roles = $roles; |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * Gets the id. |
|
| 71 | * |
|
| 72 | * @return string |
|
| 73 | */ |
|
| 74 | public function id() |
|
| 75 | { |
|
| 76 | return $this->id; |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * Gets the email. |
|
| 81 | * |
|
| 82 | * @return string |
|
| 83 | */ |
|
| 84 | public function email() |
|
| 85 | { |
|
| 86 | return $this->email; |
|
| 87 | } |
|
| 88 | ||
| 89 | /** |
|
| 90 | * Gets the user plain password. |
|
| 91 | * |
|
| 92 | * @return string |
|
| 93 | */ |
|
| 94 | public function password() |
|
| 95 | { |
|
| 96 | return $this->plainPassword; |
|
| 97 | } |
|
| 98 | ||
| 99 | /** |
|
| 100 | * Gets the roles. |
|
| 101 | * |
|
| 102 | * @return array |
|
| 103 | */ |
|
| 104 | public function roles() |
|
| 105 | { |
|
| 106 | return $this->roles; |
|
| 107 | } |
|
| 108 | } |
|
| 109 | ||
| @@ 23-108 (lines=86) @@ | ||
| 20 | * @author Beñat Espiña <[email protected]> |
|
| 21 | * @author Gorka Laucirica <[email protected]> |
|
| 22 | */ |
|
| 23 | class WithConfirmationSignUpUserCommand |
|
| 24 | { |
|
| 25 | /** |
|
| 26 | * The user id. |
|
| 27 | * |
|
| 28 | * @var string |
|
| 29 | */ |
|
| 30 | private $id; |
|
| 31 | ||
| 32 | /** |
|
| 33 | * The user email. |
|
| 34 | * |
|
| 35 | * @var string |
|
| 36 | */ |
|
| 37 | private $email; |
|
| 38 | ||
| 39 | /** |
|
| 40 | * The plain password. |
|
| 41 | * |
|
| 42 | * @var string |
|
| 43 | */ |
|
| 44 | private $plainPassword; |
|
| 45 | ||
| 46 | /** |
|
| 47 | * Array which contains the roles. |
|
| 48 | * |
|
| 49 | * @var array |
|
| 50 | */ |
|
| 51 | private $roles; |
|
| 52 | ||
| 53 | /** |
|
| 54 | * Constructor. |
|
| 55 | * |
|
| 56 | * @param string $anEmail The email |
|
| 57 | * @param string $aPlainPassword The plain password |
|
| 58 | * @param array $roles Array which contains the roles |
|
| 59 | * @param string|null $anId User id, it can be null |
|
| 60 | */ |
|
| 61 | public function __construct($anEmail, $aPlainPassword, array $roles, $anId = null) |
|
| 62 | { |
|
| 63 | $this->id = null === $anId ? Uuid::uuid4()->toString() : $anId; |
|
| 64 | $this->email = $anEmail; |
|
| 65 | $this->plainPassword = $aPlainPassword; |
|
| 66 | $this->roles = $roles; |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * Gets the id. |
|
| 71 | * |
|
| 72 | * @return string |
|
| 73 | */ |
|
| 74 | public function id() |
|
| 75 | { |
|
| 76 | return $this->id; |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * Gets the email. |
|
| 81 | * |
|
| 82 | * @return string |
|
| 83 | */ |
|
| 84 | public function email() |
|
| 85 | { |
|
| 86 | return $this->email; |
|
| 87 | } |
|
| 88 | ||
| 89 | /** |
|
| 90 | * Gets the user plain password. |
|
| 91 | * |
|
| 92 | * @return string |
|
| 93 | */ |
|
| 94 | public function password() |
|
| 95 | { |
|
| 96 | return $this->plainPassword; |
|
| 97 | } |
|
| 98 | ||
| 99 | /** |
|
| 100 | * Gets the roles. |
|
| 101 | * |
|
| 102 | * @return array |
|
| 103 | */ |
|
| 104 | public function roles() |
|
| 105 | { |
|
| 106 | return $this->roles; |
|
| 107 | } |
|
| 108 | } |
|
| 109 | ||