1 | <?php |
||
28 | class InviteUserHandler |
||
29 | { |
||
30 | /** |
||
31 | * The user invite factory. |
||
32 | * |
||
33 | * @var UserFactoryInvite |
||
34 | */ |
||
35 | private $factory; |
||
36 | |||
37 | /** |
||
38 | * The user repository. |
||
39 | * |
||
40 | * @var UserRepository |
||
41 | */ |
||
42 | private $repository; |
||
43 | |||
44 | /** |
||
45 | * Constructor. |
||
46 | * |
||
47 | * @param UserRepository $aRepository The user repository |
||
48 | * @param UserFactoryInvite $aFactory The user invite factory |
||
49 | */ |
||
50 | public function __construct(UserRepository $aRepository, UserFactoryInvite $aFactory) |
||
55 | |||
56 | /** |
||
57 | * Handles the given command. |
||
58 | * |
||
59 | * @param InviteUserCommand $aCommand The command |
||
60 | * |
||
61 | * @throws UserAlreadyExistException when the user already exists |
||
62 | */ |
||
63 | public function __invoke(InviteUserCommand $aCommand) |
||
82 | } |
||
83 |