13
13
14
14
use Doctrine \Bundle \DoctrineBundle \DependencyInjection \Compiler \DoctrineOrmMappingsPass ;
15
15
use Doctrine \Bundle \PHPCRBundle \DependencyInjection \Compiler \DoctrinePhpcrMappingsPass ;
16
+ use Doctrine \Common \Persistence \PersistentObject ;
16
17
use Doctrine \ODM \PHPCR \Mapping \Driver \XmlDriver as PHPCRXmlDriver ;
17
18
use Doctrine \ODM \PHPCR \Version as PHPCRVersion ;
18
19
use Doctrine \ORM \EntityManagerInterface ;
@@ -56,6 +57,11 @@ private function buildPhpcrCompilerPass(ContainerBuilder $container): void
56
57
$ container ->addCompilerPass (
57
58
$ this ->buildBaseCompilerPass (DoctrinePhpcrMappingsPass::class, PHPCRXmlDriver::class, 'phpcr ' )
58
59
);
60
+ $ aliasMap = [];
61
+ // short alias is no longer supported in doctrine/persistence 3, but keep aliasing for BC with old installations
62
+ if (class_exists (PersistentObject::class)) {
63
+ $ aliasMap = ['CmfRoutingBundle ' => 'Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr ' ];
64
+ }
59
65
$ container ->addCompilerPass (
60
66
DoctrinePhpcrMappingsPass::createXmlMappingDriver (
61
67
[
@@ -64,7 +70,7 @@ private function buildPhpcrCompilerPass(ContainerBuilder $container): void
64
70
],
65
71
['cmf_routing.dynamic.persistence.phpcr.manager_name ' ],
66
72
'cmf_routing.backend_type_phpcr ' ,
67
- [ ' CmfRoutingBundle ' => ' Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr ' ]
73
+ $ aliasMap
68
74
)
69
75
);
70
76
}
@@ -81,6 +87,11 @@ private function buildOrmCompilerPass(ContainerBuilder $container): void
81
87
$ container ->addCompilerPass (
82
88
$ this ->buildBaseCompilerPass (DoctrineOrmMappingsPass::class, ORMXmlDriver::class, 'orm ' )
83
89
);
90
+ $ aliasMap = [];
91
+ // short alias is no longer supported in doctrine/persistence 3, but keep aliasing for BC with old installations
92
+ if (class_exists (PersistentObject::class)) {
93
+ $ aliasMap = ['CmfRoutingBundle ' => 'Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm ' ];
94
+ }
84
95
$ container ->addCompilerPass (
85
96
DoctrineOrmMappingsPass::createXmlMappingDriver (
86
97
[
@@ -89,7 +100,7 @@ private function buildOrmCompilerPass(ContainerBuilder $container): void
89
100
],
90
101
['cmf_routing.dynamic.persistence.orm.manager_name ' ],
91
102
'cmf_routing.backend_type_orm_default ' ,
92
- [ ' CmfRoutingBundle ' => ' Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm ' ]
103
+ $ aliasMap
93
104
)
94
105
);
95
106
0 commit comments