| @@ 26-52 (lines=27) @@ | ||
| 23 | * @author Beñat Espiña <[email protected]> |
|
| 24 | * @author Gorka Laucirica <[email protected]> |
|
| 25 | */ |
|
| 26 | final class UserFactoryInvite implements BaseUserFactoryInvite |
|
| 27 | { |
|
| 28 | /** |
|
| 29 | * The entity fully qualified namespace. |
|
| 30 | * |
|
| 31 | * @var string |
|
| 32 | */ |
|
| 33 | private $class; |
|
| 34 | ||
| 35 | /** |
|
| 36 | * Constructor. |
|
| 37 | * |
|
| 38 | * @param string $aClass The entity fully qualified namespace |
|
| 39 | */ |
|
| 40 | public function __construct($aClass = User::class) |
|
| 41 | { |
|
| 42 | $this->class = $aClass; |
|
| 43 | } |
|
| 44 | ||
| 45 | /** |
|
| 46 | * {@inheritdoc} |
|
| 47 | */ |
|
| 48 | public function build(UserId $anId, UserEmail $anEmail) |
|
| 49 | { |
|
| 50 | return forward_static_call_array([$this->class, 'invite'], [$anId, $anEmail]); |
|
| 51 | } |
|
| 52 | } |
|
| 53 | ||
| @@ 27-53 (lines=27) @@ | ||
| 24 | * @author Beñat Espiña <[email protected]> |
|
| 25 | * @author Gorka Laucirica <[email protected]> |
|
| 26 | */ |
|
| 27 | final class UserFactorySignUp implements BaseUserFactorySignUp |
|
| 28 | { |
|
| 29 | /** |
|
| 30 | * The entity fully qualified namespace. |
|
| 31 | * |
|
| 32 | * @var string |
|
| 33 | */ |
|
| 34 | private $class; |
|
| 35 | ||
| 36 | /** |
|
| 37 | * Constructor. |
|
| 38 | * |
|
| 39 | * @param string $aClass The entity fully qualified namespace |
|
| 40 | */ |
|
| 41 | public function __construct($aClass = User::class) |
|
| 42 | { |
|
| 43 | $this->class = $aClass; |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * {@inheritdoc} |
|
| 48 | */ |
|
| 49 | public function build(UserId $anId, UserEmail $anEmail, UserPassword $aPassword, array $roles) |
|
| 50 | { |
|
| 51 | return forward_static_call_array([$this->class, 'signUp'], [$anId, $anEmail, $aPassword, $roles]); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||