1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Superdesk Web Publisher MultiTenancy Bundle. |
5
|
|
|
* |
6
|
|
|
* Copyright 2015 Sourcefabric z.u. and contributors. |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please see the |
9
|
|
|
* AUTHORS and LICENSE files distributed with this source code. |
10
|
|
|
* |
11
|
|
|
* @copyright 2015 Sourcefabric z.ú |
12
|
|
|
* @license http://www.superdesk.org/license |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
namespace SWP\Bundle\MultiTenancyBundle; |
16
|
|
|
|
17
|
|
|
use SWP\Bundle\MultiTenancyBundle\DependencyInjection\Compiler\ConfigurePrefixCandidatesCompilerPass; |
18
|
|
|
use SWP\Bundle\MultiTenancyBundle\DependencyInjection\Compiler\RegisterOrganizationFactoryPass; |
19
|
|
|
use SWP\Bundle\MultiTenancyBundle\DependencyInjection\Compiler\RegisterTenantFactoryCompilerPass; |
20
|
|
|
use SWP\Bundle\MultiTenancyBundle\DependencyInjection\Compiler\TenantAwareRouterCompilerPass; |
21
|
|
|
use SWP\Bundle\StorageBundle\DependencyInjection\Bundle\Bundle; |
22
|
|
|
use SWP\Bundle\StorageBundle\Drivers; |
23
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
24
|
|
|
|
25
|
|
|
class SWPMultiTenancyBundle extends Bundle |
26
|
|
|
{ |
27
|
|
|
public function build(ContainerBuilder $container) |
28
|
|
|
{ |
29
|
|
|
parent::build($container); |
30
|
|
|
$container->addCompilerPass(new ConfigurePrefixCandidatesCompilerPass()); |
31
|
|
|
$container->addCompilerPass(new TenantAwareRouterCompilerPass()); |
32
|
|
|
$container->addCompilerPass(new RegisterTenantFactoryCompilerPass()); |
33
|
|
|
$container->addCompilerPass(new RegisterOrganizationFactoryPass()); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* {@inheritdoc} |
38
|
|
|
*/ |
39
|
|
|
public function getSupportedDrivers() |
40
|
|
|
{ |
41
|
|
|
return [ |
42
|
|
|
Drivers::DRIVER_DOCTRINE_PHPCR_ODM, |
43
|
|
|
Drivers::DRIVER_DOCTRINE_ORM, |
44
|
|
|
]; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* {@inheritdoc} |
49
|
|
|
*/ |
50
|
|
|
public function getModelClassNamespace() |
51
|
|
|
{ |
52
|
|
|
return 'SWP\Component\MultiTenancy\Model'; |
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
|