|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
ÁTICA - Aplicación web para la gestión documental de centros educativos |
|
4
|
|
|
|
|
5
|
|
|
Copyright (C) 2015-2016: Luis Ramón López López |
|
6
|
|
|
|
|
7
|
|
|
This program is free software: you can redistribute it and/or modify |
|
8
|
|
|
it under the terms of the GNU Affero General Public License as published by |
|
9
|
|
|
the Free Software Foundation, either version 3 of the License, or |
|
10
|
|
|
(at your option) any later version. |
|
11
|
|
|
|
|
12
|
|
|
This program is distributed in the hope that it will be useful, |
|
13
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15
|
|
|
GNU Affero General Public License for more details. |
|
16
|
|
|
|
|
17
|
|
|
You should have received a copy of the GNU Affero General Public License |
|
18
|
|
|
along with this program. If not, see [http://www.gnu.org/licenses/]. |
|
19
|
|
|
*/ |
|
20
|
|
|
|
|
21
|
|
|
namespace AppBundle\DependencyInjection\Compiler; |
|
22
|
|
|
|
|
23
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
24
|
|
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; |
|
25
|
|
|
use Symfony\Component\DependencyInjection\Reference; |
|
26
|
|
|
|
|
27
|
|
|
class MenuCompilerPass implements CompilerPassInterface |
|
28
|
|
|
{ |
|
29
|
|
|
public function process(ContainerBuilder $container) |
|
30
|
|
|
{ |
|
31
|
|
|
if (!$container->has('app.menu_builders_chain')) { |
|
32
|
|
|
return; |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
$definition = $container->findDefinition( |
|
36
|
|
|
'app.menu_builders_chain' |
|
37
|
|
|
); |
|
38
|
|
|
|
|
39
|
|
|
$taggedServices = $container->findTaggedServiceIds( |
|
40
|
|
|
'atica_core.menu_builder' |
|
41
|
|
|
); |
|
42
|
|
|
foreach ($taggedServices as $id => $tags) { |
|
43
|
|
|
$definition->addMethodCall( |
|
44
|
|
|
'addMenuBuilder', |
|
45
|
|
|
array(new Reference($id)) |
|
46
|
|
|
); |
|
47
|
|
|
} |
|
48
|
|
|
} |
|
49
|
|
|
} |
|
50
|
|
|
|