| @@ 23-39 (lines=17) @@ | ||
| 20 | * Register the entity code generator services |
|
| 21 | * (services tagged with "blast.entity_code_generator"). |
|
| 22 | */ |
|
| 23 | class CodeGeneratorCompilerPass implements CompilerPassInterface |
|
| 24 | { |
|
| 25 | public function process(ContainerBuilder $container) |
|
| 26 | { |
|
| 27 | if (!$container->has('blast_core.code_generators')) { |
|
| 28 | return; |
|
| 29 | } |
|
| 30 | ||
| 31 | $registry = $container->findDefinition('blast_core.code_generators'); |
|
| 32 | ||
| 33 | $taggedServices = $container->findTaggedServiceIds('blast.entity_code_generator'); |
|
| 34 | ||
| 35 | foreach ($taggedServices as $id => $tags) { |
|
| 36 | $registry->addMethodCall('register', [new Reference($id)]); |
|
| 37 | } |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||
| @@ 19-35 (lines=17) @@ | ||
| 16 | use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; |
|
| 17 | use Symfony\Component\DependencyInjection\Reference; |
|
| 18 | ||
| 19 | class DashboardBlocksCompilerPass implements CompilerPassInterface |
|
| 20 | { |
|
| 21 | public function process(ContainerBuilder $container) |
|
| 22 | { |
|
| 23 | if (!$container->has('blast_core.dashboard.registry')) { |
|
| 24 | return; |
|
| 25 | } |
|
| 26 | ||
| 27 | $registry = $container->findDefinition('blast_core.dashboard.registry'); |
|
| 28 | ||
| 29 | $taggedServices = $container->findTaggedServiceIds('blast.dashboard_block'); |
|
| 30 | ||
| 31 | foreach ($taggedServices as $id => $tags) { |
|
| 32 | $registry->addMethodCall('registerBlock', [new Reference($id)]); |
|
| 33 | } |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||