File tree Expand file tree Collapse file tree 5 files changed +27
-37
lines changed Expand file tree Collapse file tree 5 files changed +27
-37
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ public function build(ContainerBuilder $container)
40
40
}
41
41
42
42
if (class_exists ('Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass ' )) {
43
+ $ container ->addCompilerPass ($ this ->buildBaseOrmCompilerPass ());
43
44
$ container ->addCompilerPass (
44
45
DoctrineOrmMappingsPass::createXmlMappingDriver (
45
46
array (
@@ -53,6 +54,20 @@ public function build(ContainerBuilder $container)
53
54
}
54
55
}
55
56
57
+ private function buildBaseOrmCompilerPass ()
58
+ {
59
+ $ arguments = array (array (realpath (__DIR__ . '/Resources/config/doctrine-base ' )), '.orm.xml ' );
60
+ $ locator = new Definition ('Doctrine\Common\Persistence\Mapping\Driver\DefaultFileLocator ' , $ arguments );
61
+ $ driver = new Definition ('Doctrine\ORM\Mapping\Driver\XmlDriver ' , array ($ locator ));
62
+
63
+ return new DoctrineOrmMappingsPass (
64
+ $ driver ,
65
+ array ('Symfony\Component\Routing ' ),
66
+ array ('cmf_routing.dynamic.persistence.orm.manager_name ' ),
67
+ 'cmf_routing.persistence.orm.enabled '
68
+ );
69
+ }
70
+
56
71
/**
57
72
* Build the compiler pass for the symfony core routing component. The
58
73
* factory method uses the SymfonyFileLocator which will look at the
Original file line number Diff line number Diff line change @@ -24,24 +24,4 @@ class Route extends RouteModel
24
24
* {@inheritDoc}
25
25
*/
26
26
protected $ addTrailingSlash ;
27
-
28
- /**
29
- * {@inheritDoc}
30
- */
31
- protected $ host ;
32
-
33
- /**
34
- * {@inheritDoc}
35
- */
36
- protected $ defaults ;
37
-
38
- /**
39
- * {@inheritDoc}
40
- */
41
- protected $ requirements ;
42
-
43
- /**
44
- * {@inheritDoc}
45
- */
46
- protected $ options ;
47
27
}
Original file line number Diff line number Diff line change @@ -259,16 +259,6 @@ public function compile()
259
259
return parent ::compile ();
260
260
}
261
261
262
- /**
263
- * {@inheritDoc}
264
- *
265
- * Required by orm
266
- */
267
- public function getDefaults ()
268
- {
269
- return $ this ->defaults ;
270
- }
271
-
272
262
public function __toString ()
273
263
{
274
264
return (string ) $ this ->id ;
Original file line number Diff line number Diff line change
1
+ <doctrine-mapping xmlns =" http://doctrine-project.org/schemas/orm/doctrine-mapping"
2
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3
+ xsi : schemaLocation =" https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd" >
4
+
5
+ <mapped-superclass name =" Symfony\Component\Routing\Route" >
6
+ <field name =" host" type =" string" />
7
+ <field name =" defaults" type =" array" />
8
+ <field name =" requirements" type =" array" />
9
+ <field name =" options" type =" array" />
10
+ </mapped-superclass >
11
+
12
+ </doctrine-mapping >
Original file line number Diff line number Diff line change 10
10
11
11
<field name =" name" type =" string" unique =" true" />
12
12
<field name =" staticPrefix" type =" string" />
13
-
14
13
<field name =" position" type =" integer" />
15
-
16
14
<field name =" addTrailingSlash" type =" boolean" />
17
15
18
- <field name =" host" type =" string" />
19
- <field name =" defaults" type =" array" />
20
- <field name =" requirements" type =" array" />
21
- <field name =" options" type =" array" />
22
-
23
16
<indexes >
24
17
<index name =" name_idx" columns =" name" />
25
18
<index name =" prefix_idx" columns =" staticPrefix" />
You can’t perform that action at this time.
0 commit comments