-
-
Notifications
You must be signed in to change notification settings - Fork 344
Allow Symfony uid as primary key for Entities managed with Sonata #1738
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 Symfony uid as primary key for Entities managed with Sonata #1738
Conversation
8ba084c
to
232c4d2
Compare
This is still WIP @VincentLanglet , but I wanted to get your opinion and also see if builds passes or not. Currently I saw the following problems with Uuid and Ulids:
Last one I am fixing right now. Besides that, everything else seems to work... the thing with uuid is that we can't rely on the __toString method to make the query to the database. We have to rely on the third parameter of the setParameter to tell doctrine which type it is, so it can properly deal with the value. At the same time we have to keep the __toString conversion on the modelManager, since when we print Uuids to the end user, we should print the normal string representation, which might not be the same as is stored (binary in some cases) Also, I have made 2 more changes:
|
Seems nice |
You say it closes sonata-project/SonataAdminBundle#7327 but is there nothing to do on the Mongo side ? |
TBH I am not sure how it should be implemented on Mongo side... not even sure if Symfony team or Doctrine team has added UuidTypes, similar to how it is done on Doctrine bridge for the ORM. IMHO if the issue ends up being persistence related only. After this PR gets merged, we can move the issue to MongoDB persistence to see if there is interest on this implementation. |
I will need to also take a look at why test for another unrelated feature are failing now. |
1bbef60
to
d3d3849
Compare
2d3bf9d
to
a5b2853
Compare
09ecda6
to
c287275
Compare
09ea6b5
to
a1412e7
Compare
ef735c6
to
ef35fb6
Compare
sprintf('%s.%s IS EMPTY', $this->getParentAlias($query, $alias), $this->getFieldName()) | ||
); | ||
if (false === $this->getAssociationMapping()['isOwningSide']) { | ||
$nullExpression = sprintf('IDENTITY(%s.%s) IS NULL', $alias, $this->getAssociationMapping()['mappedBy']); |
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.
wdyt @VincentLanglet ?
ef35fb6
to
0a3b2dc
Compare
The changelog could be improved, IMO I also fixed:
Edit: Added. |
0a3b2dc
to
4825ded
Compare
Subject
I am targeting this branch, because this is BC.
Closes sonata-project/SonataAdminBundle#7327.
Changelog