@@ 27-47 (lines=21) @@ | ||
24 | use Surfnet\StepupMiddleware\CommandHandlingBundle\Configuration\Command\CreateInstitutionConfigurationCommand; |
|
25 | use Surfnet\StepupMiddleware\CommandHandlingBundle\Pipeline\Pipeline; |
|
26 | ||
27 | final class CreateInstitutionConfigurationCommandDispatcher implements InstitutionConfigurationCreationService |
|
28 | { |
|
29 | /** |
|
30 | * @var Pipeline |
|
31 | */ |
|
32 | private $pipeline; |
|
33 | ||
34 | public function __construct(Pipeline $pipeline) |
|
35 | { |
|
36 | $this->pipeline = $pipeline; |
|
37 | } |
|
38 | ||
39 | public function createConfigurationFor(Institution $institution) |
|
40 | { |
|
41 | $command = new CreateInstitutionConfigurationCommand(); |
|
42 | $command->UUID = (string) Uuid::uuid4(); |
|
43 | $command->institution = $institution; |
|
44 | ||
45 | $this->pipeline->process($command); |
|
46 | } |
|
47 | } |
|
48 |
@@ 27-47 (lines=21) @@ | ||
24 | use Surfnet\StepupMiddleware\CommandHandlingBundle\Configuration\Command\CreateInstitutionConfigurationCommand; |
|
25 | use Surfnet\StepupMiddleware\CommandHandlingBundle\Pipeline\Pipeline; |
|
26 | ||
27 | final class CreateInstitutionConfigurationCommandDispatcher implements InstitutionConfigurationCreationService |
|
28 | { |
|
29 | /** |
|
30 | * @var Pipeline |
|
31 | */ |
|
32 | private $pipeline; |
|
33 | ||
34 | public function __construct(Pipeline $pipeline) |
|
35 | { |
|
36 | $this->pipeline = $pipeline; |
|
37 | } |
|
38 | ||
39 | public function createConfigurationFor(Institution $institution) |
|
40 | { |
|
41 | $command = new CreateInstitutionConfigurationCommand(); |
|
42 | $command->UUID = (string) Uuid::uuid4(); |
|
43 | $command->institution = $institution; |
|
44 | ||
45 | $this->pipeline->process($command); |
|
46 | } |
|
47 | } |
|
48 |