-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow UUIDs for Blameable fields #2642
Allow UUIDs for Blameable fields #2642
Conversation
I think it would make sense to move the |
36ea031
to
ca1dd13
Compare
I've added the CHANGELOG.md entry, but without requiring ramsey/uuid-doctrine this can't be tested. I can add it as a DEV requirement if you want? |
Do you require/want any additional changes? |
Yes. Please, review the failing CI jobs. The pipeline must succeed in order to merge. |
It seems that |
db09694
to
1284926
Compare
1284926
to
1727d18
Compare
1727d18
to
c93928d
Compare
c93928d
to
9ba8180
Compare
I've updated the branch and moved the CHANGELOG.md entry to [Unreleased]. |
Instead of using that package, the tests I set up looking at #2701 uses Symfony's UID and Doctrine Bridge packages (the latter of which is already pulled in thanks to the dev dependency chain). The PHP version constraint isn't an issue anymore, but, I'd say we'd want to support both |
9ba8180
to
bb28d1c
Compare
When I created this PR, Doctrine was mostly using I've added The packages are interchangeable, you just have to replace the generator in the annotation/attribute as well. |
Co-authored-by: Michael Babker <michael.babker@gmail.com>
Thanks @fwolfsjaeger! and @mbabker |
Feature request: #2641
I'm using UUID as primary key fields and I would like to store the users' UUID in the createdBy/updatedBy fields using the Blameable annotation/attribute.
To allow UUIDs, I've extended the
validTypes
array in the annotation/XML/YAML driver with 'uuid'.Moved to separate PR: #2645
In order to convert the given value to whatever type is required, in my case UuidV6 from the Symfony UID component, I've amended the functionality of
src/AbstractTrackingListener.php
. I'm checking for a setter method to use that one instead of setting the property value directly.