| @@ 9-30 (lines=22) @@ | ||
| 6 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
| 7 | use Symfony\Component\DependencyInjection\Reference; |
|
| 8 | ||
| 9 | class DataSourceryBundleExtensionServicePass implements CompilerPassInterface |
|
| 10 | { |
|
| 11 | /** |
|
| 12 | * You can modify the container here before it is dumped to PHP code. |
|
| 13 | * |
|
| 14 | * @param ContainerBuilder $container |
|
| 15 | * |
|
| 16 | * @api |
|
| 17 | */ |
|
| 18 | public function process(ContainerBuilder $container) |
|
| 19 | { |
|
| 20 | if (!$container->hasDefinition('netdudes_data_sourcery.uql_extension_container')) { |
|
| 21 | return; |
|
| 22 | } |
|
| 23 | ||
| 24 | $extensionContainer = $container->getDefinition('netdudes_data_sourcery.uql_extension_container'); |
|
| 25 | ||
| 26 | foreach ($container->findTaggedServiceIds('netdudes_data_sourcery.extension') as $id => $attributes) { |
|
| 27 | $extensionContainer->addMethodCall('addExtension', [new Reference($id)]); |
|
| 28 | } |
|
| 29 | } |
|
| 30 | } |
|
| 31 | ||
| @@ 9-26 (lines=18) @@ | ||
| 6 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
| 7 | use Symfony\Component\DependencyInjection\Reference; |
|
| 8 | ||
| 9 | class InterpreterEventSubscriberPass implements CompilerPassInterface |
|
| 10 | { |
|
| 11 | /** |
|
| 12 | * {@inheritdoc} |
|
| 13 | */ |
|
| 14 | public function process(ContainerBuilder $container) |
|
| 15 | { |
|
| 16 | if (!$container->hasDefinition('netdudes_data_sourcery.query.filter_condition_factory')) { |
|
| 17 | return; |
|
| 18 | } |
|
| 19 | ||
| 20 | $filterConditionFactory = $container->getDefinition('netdudes_data_sourcery.query.filter_condition_factory'); |
|
| 21 | ||
| 22 | foreach ($container->findTaggedServiceIds('data_sourcery.interpreter.event_subscriber') as $id => $attributes) { |
|
| 23 | $filterConditionFactory->addMethodCall('registerEventSubscriber', [new Reference($id)]); |
|
| 24 | } |
|
| 25 | } |
|
| 26 | } |
|
| 27 | ||