forked from sergeil/SliExtJsIntegrationBundle
/
SliExtJsIntegrationBundle.php
43 lines (36 loc) · 1.51 KB
/
SliExtJsIntegrationBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace Sli\ExtJsIntegrationBundle;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Sli\ExpanderBundle\DependencyInjection\CompositeContributorsProviderCompilerPass;
use Sli\ExpanderBundle\Ext\ExtensionPoint;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Kernel;
SliExtJsIntegrationBundle::loadAnnotations();
class SliExtJsIntegrationBundle extends Bundle
{
static public function loadAnnotations()
{
$reflClass = new \ReflectionClass(__CLASS__);
$path = dirname($reflClass->getFileName());
AnnotationRegistry::registerFile(
$path . '/DataMapping/Annotations.php'
);
AnnotationRegistry::registerFile(
$path . '/Service/SortingFieldAnnotations.php'
);
}
public function build(ContainerBuilder $container)
{
// FIXME ain't good, it must be done rather in RendererProvidersConfigurator
$container->addCompilerPass(
new CompositeContributorsProviderCompilerPass(
'sli.extjsintegration.expander_renderers_provider',
'sli.extjsintegration.renderers_provider'
)
);
$valueConverterProviders = new ExtensionPoint('sli.extjsintegration.complex_field_value_converters');
$valueConverterProviders->setDescription('Allows to contribute custom value converters');
$container->addCompilerPass($valueConverterProviders->createCompilerPass());
}
}