Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8fbf196

Browse filesBrowse files
jwagefabpot
authored andcommitted
Adding orm: and mongodb: annotation aliases to avoid conflicts. Recommended is to use the aliases instead of relying on the default namespace for annotations.
/** @Orm:Entity */ /** @mongodb:Document */
1 parent 0fc8906 commit 8fbf196
Copy full SHA for 8fbf196

File tree

Expand file treeCollapse file tree

2 files changed

+9
-0
lines changed
Filter options
  • src/Symfony/Bundle
Expand file treeCollapse file tree

2 files changed

+9
-0
lines changed

‎src/Symfony/Bundle/DoctrineBundle/Resources/config/orm.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/DoctrineBundle/Resources/config/orm.xml
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
<service id="doctrine.orm.metadata_driver.annotation" class="Doctrine\ORM\Mapping\Driver\AnnotationDriver">
4646
<argument type="service" id="doctrine.orm.metadata_driver.annotation.reader" />
4747
<argument>%doctrine.orm.metadata_driver.entity_dirs%</argument>
48+
<call method="setDefaultAnnotationNamespace"><argument>%doctrine.orm.metadata.annotation_default_namespace%</argument></call>
49+
<call method="setAnnotationNamespaceAlias">
50+
<argument>Doctrine\ORM\Mapping\</argument>
51+
<argument>orm</argument>
52+
</call>
4853
</service>
4954

5055
<service id="doctrine.orm.metadata_driver.annotation.reader" class="Doctrine\Common\Annotations\AnnotationReader">

‎src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/config/mongodb.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/config/mongodb.xml
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
<service id="doctrine.odm.mongodb.metadata.annotation_reader" class="%doctrine.odm.mongodb.metadata.annotation_reader_class%">
5858
<argument type="service" id="doctrine.odm.mongodb.cache" />
5959
<call method="setDefaultAnnotationNamespace"><argument>%doctrine.odm.mongodb.metadata.annotation_default_namespace%</argument></call>
60+
<call method="setAnnotationNamespaceAlias">
61+
<argument>Doctrine\ODM\MongoDB\Mapping\</argument>
62+
<argument>mongodb</argument>
63+
</call>
6064
</service>
6165
<service id="doctrine.odm.mongodb.metadata.xml" class="%doctrine.odm.mongodb.metadata.xml_class%"><argument>%doctrine.odm.mongodb.xml_mapping_dirs%</argument></service>
6266
<service id="doctrine.odm.mongodb.metadata.yml" class="%doctrine.odm.mongodb.metadata.yml_class%"><argument>%doctrine.odm.mongodb.yml_mapping_dirs%</argument></service>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.