@@ 9-21 (lines=13) @@ | ||
6 | use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; |
|
7 | use Symfony\Component\DependencyInjection\Reference; |
|
8 | ||
9 | class PostsMapPass implements CompilerPassInterface |
|
10 | { |
|
11 | public function process(ContainerBuilder $container) |
|
12 | { |
|
13 | $definition = $container->getDefinition('sculpin_posts.posts_map'); |
|
14 | ||
15 | foreach ($container->findTaggedServiceIds('sculpin_posts.posts_map') as $id => $tagAttributes) { |
|
16 | foreach ($tagAttributes as $attributes) { |
|
17 | $definition->addMethodCall('addMap', [new Reference($id)]); |
|
18 | } |
|
19 | } |
|
20 | } |
|
21 | } |
|
22 |
@@ 18-31 (lines=14) @@ | ||
15 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
16 | use Symfony\Component\DependencyInjection\Reference; |
|
17 | ||
18 | final class DataSourcePass implements CompilerPassInterface |
|
19 | { |
|
20 | /** |
|
21 | * {@inheritdoc} |
|
22 | */ |
|
23 | public function process(ContainerBuilder $container) |
|
24 | { |
|
25 | $definition = $container->getDefinition('sculpin.data_source'); |
|
26 | ||
27 | foreach ($container->findTaggedServiceIds('sculpin.data_source') as $id => $tagAttributes) { |
|
28 | $definition->addMethodCall('addDataSource', [new Reference($id)]); |
|
29 | } |
|
30 | } |
|
31 | } |
|
32 |