src/Kunstmaan/FixturesBundle/DependencyInjection/Compiler/BuilderCompilerPass.php 1 location
|
@@ 9-32 (lines=24) @@
|
6 |
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
7 |
|
use Symfony\Component\DependencyInjection\Reference; |
8 |
|
|
9 |
|
class BuilderCompilerPass implements CompilerPassInterface |
10 |
|
{ |
11 |
|
/** |
12 |
|
* @param ContainerBuilder $container |
13 |
|
*/ |
14 |
|
public function process(ContainerBuilder $container) |
15 |
|
{ |
16 |
|
if (!$container->hasDefinition('kunstmaan_fixtures.builder.builder')) { |
17 |
|
return; |
18 |
|
} |
19 |
|
|
20 |
|
$definition = $container->getDefinition('kunstmaan_fixtures.builder.builder'); |
21 |
|
$taggedServices = $container->findTaggedServiceIds('kunstmaan_fixtures.builder'); |
22 |
|
|
23 |
|
foreach ($taggedServices as $id => $tagAttributes) { |
24 |
|
foreach ($tagAttributes as $attributes) { |
25 |
|
$definition->addMethodCall( |
26 |
|
'addBuilder', |
27 |
|
array(new Reference($id), $attributes['alias']) |
28 |
|
); |
29 |
|
} |
30 |
|
} |
31 |
|
} |
32 |
|
} |
33 |
|
|
src/Kunstmaan/FixturesBundle/DependencyInjection/Compiler/PopulatorCompilerPass.php 1 location
|
@@ 9-32 (lines=24) @@
|
6 |
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
7 |
|
use Symfony\Component\DependencyInjection\Reference; |
8 |
|
|
9 |
|
class PopulatorCompilerPass implements CompilerPassInterface |
10 |
|
{ |
11 |
|
/** |
12 |
|
* @param ContainerBuilder $container |
13 |
|
*/ |
14 |
|
public function process(ContainerBuilder $container) |
15 |
|
{ |
16 |
|
if (!$container->hasDefinition('kunstmaan_fixtures.builder.builder')) { |
17 |
|
return; |
18 |
|
} |
19 |
|
|
20 |
|
$definition = $container->getDefinition('kunstmaan_fixtures.populator.populator'); |
21 |
|
$taggedServices = $container->findTaggedServiceIds('kunstmaan_fixtures.populator'); |
22 |
|
|
23 |
|
foreach ($taggedServices as $id => $tagAttributes) { |
24 |
|
foreach ($tagAttributes as $attributes) { |
25 |
|
$definition->addMethodCall( |
26 |
|
'addPopulator', |
27 |
|
[new Reference($id), $attributes['alias']] |
28 |
|
); |
29 |
|
} |
30 |
|
} |
31 |
|
} |
32 |
|
} |
33 |
|
|
src/Kunstmaan/FixturesBundle/DependencyInjection/Compiler/ProviderCompilerPass.php 1 location
|
@@ 9-32 (lines=24) @@
|
6 |
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
7 |
|
use Symfony\Component\DependencyInjection\Reference; |
8 |
|
|
9 |
|
class ProviderCompilerPass implements CompilerPassInterface |
10 |
|
{ |
11 |
|
/** |
12 |
|
* @param ContainerBuilder $container |
13 |
|
*/ |
14 |
|
public function process(ContainerBuilder $container) |
15 |
|
{ |
16 |
|
if (!$container->hasDefinition('kunstmaan_fixtures.builder.builder')) { |
17 |
|
return; |
18 |
|
} |
19 |
|
|
20 |
|
$definition = $container->getDefinition('kunstmaan_fixtures.builder.builder'); |
21 |
|
$taggedServices = $container->findTaggedServiceIds('kunstmaan_fixtures.provider'); |
22 |
|
|
23 |
|
foreach ($taggedServices as $id => $tagAttributes) { |
24 |
|
foreach ($tagAttributes as $attributes) { |
25 |
|
$definition->addMethodCall( |
26 |
|
'addProvider', |
27 |
|
array(new Reference($id), $attributes['alias']) |
28 |
|
); |
29 |
|
} |
30 |
|
} |
31 |
|
} |
32 |
|
} |
33 |
|
|
src/Kunstmaan/SearchBundle/DependencyInjection/Compiler/SearchConfigurationCompilerPass.php 1 location
|
@@ 15-38 (lines=24) @@
|
12 |
|
* Will find all services tagged "kunstmaan_search.search_configuration" and will add them to the chain with their |
13 |
|
* alias. |
14 |
|
*/ |
15 |
|
class SearchConfigurationCompilerPass implements CompilerPassInterface |
16 |
|
{ |
17 |
|
/** |
18 |
|
* @param ContainerBuilder $container |
19 |
|
*/ |
20 |
|
public function process(ContainerBuilder $container) |
21 |
|
{ |
22 |
|
if (!$container->hasDefinition('kunstmaan_search.search_configuration_chain')) { |
23 |
|
return; |
24 |
|
} |
25 |
|
|
26 |
|
$definition = $container->getDefinition('kunstmaan_search.search_configuration_chain'); |
27 |
|
$taggedServices = $container->findTaggedServiceIds('kunstmaan_search.search_configuration'); |
28 |
|
|
29 |
|
foreach ($taggedServices as $id => $tagAttributes) { |
30 |
|
foreach ($tagAttributes as $attributes) { |
31 |
|
$definition->addMethodCall( |
32 |
|
'addConfiguration', |
33 |
|
array(new Reference($id), $attributes['alias']) |
34 |
|
); |
35 |
|
} |
36 |
|
} |
37 |
|
} |
38 |
|
} |
39 |
|
|
src/Kunstmaan/SearchBundle/DependencyInjection/Compiler/SearchProviderCompilerPass.php 1 location
|
@@ 14-37 (lines=24) @@
|
11 |
|
* |
12 |
|
* Will find all services tagged "kunstmaan_search.searchprovider" and will add them to the chain with their alias. |
13 |
|
*/ |
14 |
|
class SearchProviderCompilerPass implements CompilerPassInterface |
15 |
|
{ |
16 |
|
/** |
17 |
|
* @param ContainerBuilder $container |
18 |
|
*/ |
19 |
|
public function process(ContainerBuilder $container) |
20 |
|
{ |
21 |
|
if (!$container->hasDefinition('kunstmaan_search.search_provider_chain')) { |
22 |
|
return; |
23 |
|
} |
24 |
|
|
25 |
|
$definition = $container->getDefinition('kunstmaan_search.search_provider_chain'); |
26 |
|
$taggedServices = $container->findTaggedServiceIds('kunstmaan_search.search_provider'); |
27 |
|
|
28 |
|
foreach ($taggedServices as $id => $tagAttributes) { |
29 |
|
foreach ($tagAttributes as $attributes) { |
30 |
|
$definition->addMethodCall( |
31 |
|
'addProvider', |
32 |
|
array(new Reference($id), $attributes['alias']) |
33 |
|
); |
34 |
|
} |
35 |
|
} |
36 |
|
} |
37 |
|
} |
38 |
|
|