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
|
@@ 26-37 (lines=12) @@
|
| 23 |
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
| 24 |
|
use Symfony\Component\DependencyInjection\Reference; |
| 25 |
|
|
| 26 |
|
class CollectProjectorsForEventReplayCompilerPass implements CompilerPassInterface |
| 27 |
|
{ |
| 28 |
|
public function process(ContainerBuilder $container) |
| 29 |
|
{ |
| 30 |
|
$projectorCollectionDefinition = $container->getDefinition('middleware.event_replay.projector_collection'); |
| 31 |
|
$projectorDefinitions = $container->findTaggedServiceIds('projector.register_for_replay'); |
| 32 |
|
|
| 33 |
|
foreach (array_keys($projectorDefinitions) as $serviceId) { |
| 34 |
|
$projectorCollectionDefinition->addMethodCall('add', [new Reference($serviceId)]); |
| 35 |
|
} |
| 36 |
|
} |
| 37 |
|
} |
| 38 |
|
|