src/Surfnet/StepupMiddleware/CommandHandlingBundle/DependencyInjection/CompilerPass/AddCommandBusCommandHandlersCompilerPass.php 1 location
|
@@ 25-36 (lines=12) @@
|
22 |
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
23 |
|
use Symfony\Component\DependencyInjection\Reference; |
24 |
|
|
25 |
|
class AddCommandBusCommandHandlersCompilerPass implements CompilerPassInterface |
26 |
|
{ |
27 |
|
public function process(ContainerBuilder $container) |
28 |
|
{ |
29 |
|
$definition = $container->getDefinition('surfnet_stepup_middleware_command_handling.command_bus'); |
30 |
|
$commandHandlerDefinitions = $container->findTaggedServiceIds('command_bus.command_handler'); |
31 |
|
|
32 |
|
foreach (array_keys($commandHandlerDefinitions) as $id) { |
33 |
|
$definition->addMethodCall('subscribe', [new Reference($id)]); |
34 |
|
} |
35 |
|
} |
36 |
|
} |
37 |
|
|
src/Surfnet/StepupMiddleware/MiddlewareBundle/DependencyInjection/CompilerPass/CollectProjectorsForEventReplayCompilerPass.php 1 location
|
@@ 25-36 (lines=12) @@
|
22 |
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
23 |
|
use Symfony\Component\DependencyInjection\Reference; |
24 |
|
|
25 |
|
class CollectProjectorsForEventReplayCompilerPass implements CompilerPassInterface |
26 |
|
{ |
27 |
|
public function process(ContainerBuilder $container) |
28 |
|
{ |
29 |
|
$projectorCollectionDefinition = $container->getDefinition('middleware.event_replay.projector_collection'); |
30 |
|
$projectorDefinitions = $container->findTaggedServiceIds('projector.register_for_replay'); |
31 |
|
|
32 |
|
foreach (array_keys($projectorDefinitions) as $serviceId) { |
33 |
|
$projectorCollectionDefinition->addMethodCall('add', [new Reference($serviceId)]); |
34 |
|
} |
35 |
|
} |
36 |
|
} |
37 |
|
|