|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace KGzocha\Bundle\SearcherBundle; |
|
4
|
|
|
|
|
5
|
|
|
use KGzocha\Bundle\SearcherBundle\DependencyInjection\CompilerPass\CellCollectionCompilerPass; |
|
6
|
|
|
use KGzocha\Bundle\SearcherBundle\DependencyInjection\CompilerPass\CellCompilerPass; |
|
7
|
|
|
use KGzocha\Bundle\SearcherBundle\DependencyInjection\CompilerPass\ChainSearchCompilerPass; |
|
8
|
|
|
use KGzocha\Bundle\SearcherBundle\DependencyInjection\CompilerPass\CriteriaBuilderCollectionCompilerPass; |
|
9
|
|
|
use KGzocha\Bundle\SearcherBundle\DependencyInjection\CompilerPass\CriteriaBuilderCompilerPass; |
|
10
|
|
|
use KGzocha\Bundle\SearcherBundle\DependencyInjection\CompilerPass\CriteriaCollectionCompilerPass; |
|
11
|
|
|
use KGzocha\Bundle\SearcherBundle\DependencyInjection\CompilerPass\CriteriaCompilerPass; |
|
12
|
|
|
use KGzocha\Bundle\SearcherBundle\DependencyInjection\CompilerPass\DefinitionBuilder; |
|
13
|
|
|
use KGzocha\Bundle\SearcherBundle\DependencyInjection\CompilerPass\ParametersValidator; |
|
14
|
|
|
use KGzocha\Bundle\SearcherBundle\DependencyInjection\CompilerPass\SearcherCompilerPass; |
|
15
|
|
|
use KGzocha\Bundle\SearcherBundle\DependencyInjection\CompilerPass\SearchingContextCompilerPass; |
|
16
|
|
|
use KGzocha\Bundle\SearcherBundle\DependencyInjection\CompilerPass\TransformerCompilerPass; |
|
17
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
18
|
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @author Krzysztof Gzocha <[email protected]> |
|
22
|
|
|
*/ |
|
23
|
|
|
class KGzochaSearcherBundle extends Bundle |
|
24
|
|
|
{ |
|
25
|
|
|
/** |
|
26
|
|
|
* @param ContainerBuilder $container |
|
27
|
|
|
*/ |
|
28
|
1 |
|
public function build(ContainerBuilder $container) |
|
29
|
|
|
{ |
|
30
|
1 |
|
parent::build($container); |
|
31
|
1 |
|
$parametersValidator = new ParametersValidator(); |
|
32
|
1 |
|
$builder = new DefinitionBuilder($parametersValidator); |
|
33
|
1 |
|
$servicePrefix = $this->getContainerExtension()->getAlias(); |
|
34
|
|
|
|
|
35
|
1 |
|
$container->addCompilerPass(new CriteriaCollectionCompilerPass( |
|
36
|
|
|
$builder, |
|
37
|
|
|
$servicePrefix |
|
38
|
|
|
)); |
|
39
|
1 |
|
$container->addCompilerPass(new CriteriaBuilderCollectionCompilerPass( |
|
40
|
|
|
$builder, |
|
41
|
|
|
$servicePrefix |
|
42
|
|
|
)); |
|
43
|
1 |
|
$container->addCompilerPass(new CriteriaBuilderCompilerPass( |
|
44
|
|
|
$builder, |
|
45
|
|
|
$servicePrefix |
|
46
|
|
|
)); |
|
47
|
1 |
|
$container->addCompilerPass(new CriteriaCompilerPass( |
|
48
|
|
|
$builder, |
|
49
|
|
|
$servicePrefix |
|
50
|
|
|
)); |
|
51
|
1 |
|
$container->addCompilerPass(new SearchingContextCompilerPass( |
|
52
|
|
|
$builder, |
|
53
|
|
|
$servicePrefix |
|
54
|
|
|
)); |
|
55
|
1 |
|
$container->addCompilerPass(new SearcherCompilerPass( |
|
56
|
|
|
$builder, |
|
57
|
|
|
$servicePrefix, |
|
58
|
|
|
$parametersValidator |
|
59
|
|
|
)); |
|
60
|
|
|
|
|
61
|
|
|
// Chain search compiler passes |
|
62
|
1 |
|
$container->addCompilerPass(new CellCompilerPass( |
|
63
|
|
|
$builder, |
|
64
|
|
|
$servicePrefix |
|
65
|
|
|
)); |
|
66
|
1 |
|
$container->addCompilerPass(new TransformerCompilerPass( |
|
67
|
|
|
$builder, |
|
68
|
|
|
$servicePrefix |
|
69
|
|
|
)); |
|
70
|
1 |
|
$container->addCompilerPass(new CellCollectionCompilerPass( |
|
71
|
|
|
$builder, |
|
72
|
|
|
$servicePrefix |
|
73
|
|
|
)); |
|
74
|
1 |
|
$container->addCompilerPass(new ChainSearchCompilerPass( |
|
75
|
|
|
$builder, |
|
76
|
|
|
$servicePrefix |
|
77
|
|
|
)); |
|
78
|
1 |
|
} |
|
79
|
|
|
} |
|
80
|
|
|
|