-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Convert MongoDB tutorial to PHP Attributes #2079
Conversation
api-platform/doctrine-odm is required but mapping.paths automatically contains ODM Document dir
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.
Thanks!
|
||
mapping: | ||
paths: | ||
['%kernel.project_dir%/src/Entity', '%kernel.project_dir%/src/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.
This configuration is not necessary as is it by default.
https://github.com/api-platform/core/blob/de3bed269838556d46899e78ed5603b7e6229e8b/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php#L399-L401
*/ | ||
public $product; | ||
#[ODM\Id(strategy: 'INCREMENT', type: 'int')] | ||
private int $id; |
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.
Adding prop types.
- MONGO_INITDB_DATABASE=api | ||
- MONGO_INITDB_ROOT_USERNAME=api-platform | ||
- MONGODB_INITDB_DATABASE=api | ||
- MONGODB_INITDB_ROOT_USERNAME=api-platform |
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.
Replacing legacy env vars from the mongo
docker image, with the new env vars that works with mongodb/mongodb-atlas-local
and mongodb/mongodb-community-server
.
Cool! |
Thank you very much @GromNaN! |
I replayed the tutorial to make sure it was still valid. A few updates (in comments).