-
-
Notifications
You must be signed in to change notification settings - Fork 455
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
Enable @CustomIdGenerator()
to reference services tagged as "doctrine.id_generator"
#1284
Conversation
ebf5641
to
73ce3eb
Compare
70d3f58
to
a62078c
Compare
You are changing this a lot. We will review after you are done. We will also need tests in the end. But feature is welcome. |
a62078c
to
1345b62
Compare
… Uid generators (nicolas-grekas) This PR was merged into the 5.2 branch. Discussion ---------- [DoctrineBridge] add missing `@experimental` annotation on Uid generators | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Forgotten when we created the classes. Needed since I plan to remove all the `UuidV*` generators. They're useless and a more flexible approach based on doctrine/DoctrineBundle#1284 is coming. Commits ------- e380102 [DoctrineBridge] add missing `@experimental` annotation on Uid generators
I was fighting the CS checker ;) |
aa46925
to
e61237e
Compare
12a4f5a
to
c8caaf5
Compare
PR is now tested and ready for review. |
3f58beb
to
a2f59c8
Compare
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.
So far looks like a can of worms to me without having doctrine/orm#7134
8f92b94
to
dc74aba
Compare
Thanks for the review @ostrolucky. I fixed the most technical comments. I'll let you know when I'm done with the remaining ones. |
a51ee30
to
8385e1c
Compare
Now with a doc page. Ready for another review. |
8385e1c
to
4f566fd
Compare
4f566fd
to
f1799b2
Compare
<service id="doctrine.uuid_generator" class="Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator" public="false"> | ||
<argument type="service" id="uuid.factory" on-invalid="ignore" /> | ||
<tag name="doctrine.id_generator" /> | ||
</service> |
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.
added back now that symfony/symfony#39507 is merged
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 is a great addition that makes working with ID generators in Symfony so much easier, thank you very much @nicolas-grekas!
I've left some comments, but in general this LGTM!
cef1b6c
to
e174049
Compare
…ne.id_generator"
e174049
to
148eb8f
Compare
Am I allowed to merge now that the two of you approved the PR? |
Fixes #759
This PR enables referencing services when using the
@CustomIdGenerator()
annotation.It works by creating a service locator of all services tagged as
doctrine.id_generator
, and checking that locator when a custom id generator is found. Usage: