-
-
Notifications
You must be signed in to change notification settings - Fork 660
Add DoctrineMongoDBBundle recipe #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -0,0 +1,18 @@ | |||
doctrine_mongodb: | |||
auto_generate_proxy_classes: "%kernel.debug%" | |||
auto_generate_hydrator_classes: "%kernel.debug%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using single quotes. Double quotes in YAML require escaping lots of things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the officiel recipe for doctrine/doctrine-bundle
, we use double quotes for this parameter.
is_bundle: false | ||
type: annotation | ||
dir: "%kernel.project_dir%/src/Document" | ||
prefix: "App\\Document\\" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We often voluntarily remove quotes for class names and would just use prefix: App\Document\
in this case, it should work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not inline with the official Doctrine ORM recipe.
"src/": "%SRC_DIR%/" | ||
}, | ||
"env": { | ||
"MONGODB_URL": "mongodb://localhost:27017", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the other constant and suffix it to the url to keep consistency with Doctrine ORM recipe and then simply have
"MONGODB_URL": "mongodb://localhost:27017/symfony",
?
One thing I don't know how to translate is the 2 lines that we needed to add to the old |
The ORM annotation driver was lazy-loaded in symfony/symfony#21837, maybe something similar could be done for the ODM, I don't know 😕 |
Actually, as the ODM bundle uses the annotation_reader defined by Symfony, it automatically benefits from the change done in Symfony (as long as the ODM annotations are autoloadable, but I think they are). |
Yeah. I tested it in a fresh application and it works as expected. |
Should be good now. |
Thank you @Lctrs. |
No description provided.