-
Notifications
You must be signed in to change notification settings - Fork 42
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
[Example] Assign route to custom entity #87
base: example/custom-entity
Are you sure you want to change the base?
Conversation
1abeb02
to
f72cc3c
Compare
19b7d58
to
9f4a7f0
Compare
db5c6f4
to
15ca3f0
Compare
15ca3f0
to
16e059c
Compare
9f4a7f0
to
4653f9f
Compare
16e059c
to
935c1f1
Compare
4653f9f
to
cd4fe57
Compare
ed2768e
to
113d9b0
Compare
cd4fe57
to
3a052f7
Compare
32d4cf3
to
a62a4d3
Compare
3a052f7
to
3ccf457
Compare
d6685c3
to
2c95306
Compare
3ccf457
to
737467e
Compare
2c95306
to
643df83
Compare
737467e
to
2f49214
Compare
643df83
to
6ef010e
Compare
2f49214
to
c992698
Compare
6ef010e
to
cdb9426
Compare
c992698
to
d052269
Compare
d052269
to
7265b30
Compare
cdb9426
to
d8f6fef
Compare
7265b30
to
69b1e17
Compare
d8f6fef
to
7066b2c
Compare
69b1e17
to
46a3a42
Compare
7066b2c
to
b0bf44b
Compare
46a3a42
to
66a3d03
Compare
491f2cd
to
6734f2a
Compare
66a3d03
to
18cd7be
Compare
6734f2a
to
5ae3bb3
Compare
5ae3bb3
to
6f021c3
Compare
protected function updateRoutesForEntity(Event $entity): void | ||
{ | ||
// create route for all locales of the application because event entity is not localized | ||
foreach ($this->webspaceManager->getAllLocales() as $locale) { |
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.
What's the reason of going through all locales, when updating a route for specific locale? This usually would throw an error with NULL for the rest of the locales that are not currently edited/created
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.
As stated in the comment in the previous line, the event entity of the example is not localized. If your entity is localized, you want to update only the route of the current locale 🙂
Thank you for this Example! |
What's in this PR?
This PR demonstrates how to add a route to a custom entity using the
route
content type and theRouteBundle
. This PR builds upon #84.To apply the changes, the schema of the database needs to be updated by executing
bin/console doctrine:schema:update --force
.