forked from schmittjoh/serializer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'DoctrineObjectInstructor-Improvements'
- Loading branch information
Showing
1 changed file
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e10c174
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.
I need this change in my project...why you didn't pull request this change?
Thanks!
e10c174
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.
Hey, I wrote a lengthy post asking about this issue, and this repo was so I could have that discussion. I never got an answer, so I'm still not sure if not creating the object is intentional, or a bug.
Since it appears that at least one other person agrees with me on this, I'll make a pull request.
e10c174
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.
I found another solution to customize the behaviour...
schmittjoh#333 (comment)
With this you don't need a pull request, using the service alias by config is enought I think...
e10c174
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.
I took a similar route when I ran into this. I declared the fixed version you see above as a service in Symfony, then aliased jms_serializer.object_constructor. Example:
It hasn't bitten me yet.
e10c174
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.
Hi! well...thinking about this, I believe that the default behaviour should contemplate the creation of an entity with the ID assigned, not only an update.
I agree with you to make a pull request 👍
Thanks!
e10c174
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.
You can also declare your service without having to copy JMS code: https://gist.github.com/magnetik/1815d79e7380c0339e88