|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the Sylius package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Paweł Jędrzejewski |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace Sylius\Bundle\ResourceBundle; |
|
13
|
|
|
|
|
14
|
|
|
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\DoctrineTargetEntitiesResolverPass; |
|
15
|
|
|
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\RegisterFormBuilderPass; |
|
16
|
|
|
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\RegisterResourceRepositoryPass; |
|
17
|
|
|
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\RegisterResourcesPass; |
|
18
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
19
|
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* @author Paweł Jędrzejewski <[email protected]> |
|
23
|
|
|
*/ |
|
24
|
|
|
final class SyliusResourceBundle extends Bundle |
|
25
|
|
|
{ |
|
26
|
|
|
const DRIVER_DOCTRINE_ORM = 'doctrine/orm'; |
|
27
|
|
|
const DRIVER_DOCTRINE_MONGODB_ODM = 'doctrine/mongodb-odm'; |
|
28
|
|
|
const DRIVER_DOCTRINE_PHPCR_ODM = 'doctrine/phpcr-odm'; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* {@inheritdoc} |
|
32
|
|
|
*/ |
|
33
|
|
|
public function build(ContainerBuilder $container) |
|
34
|
|
|
{ |
|
35
|
|
|
parent::build($container); |
|
36
|
|
|
|
|
37
|
|
|
$container->addCompilerPass(new RegisterResourcesPass()); |
|
38
|
|
|
$container->addCompilerPass(new DoctrineTargetEntitiesResolverPass()); |
|
39
|
|
|
$container->addCompilerPass(new RegisterResourceRepositoryPass()); |
|
40
|
|
|
$container->addCompilerPass(new RegisterFormBuilderPass()); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @return string[] |
|
45
|
|
|
*/ |
|
46
|
|
|
public static function getAvailableDrivers() |
|
47
|
|
|
{ |
|
48
|
|
|
return [ |
|
49
|
|
|
self::DRIVER_DOCTRINE_ORM, |
|
50
|
|
|
self::DRIVER_DOCTRINE_MONGODB_ODM, |
|
51
|
|
|
self::DRIVER_DOCTRINE_PHPCR_ODM, |
|
52
|
|
|
]; |
|
53
|
|
|
} |
|
54
|
|
|
} |
|
55
|
|
|
|