-
Notifications
You must be signed in to change notification settings - Fork 35
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
Q: doctrine usage #82
Comments
i see this is actually an issue with your serialiser nilportugues/php-serializer#14 |
Perhaps not : The JsonApiSerializer extends DeepCopySerializer which doesn't seem to protect against circular dependencies... |
Circular dependencies are bad design. I can code against bad design, but it really introduces lots of complexity to the library to support a bad practice. |
Hi, I rather do it right then wrong... But I would argue circular dependencies aren't bad design perse. They exist in doctrine entities. Think of a one to many relationship. Although I am never interested in traversing the identity from a Preference. I want the relationship defined in the owning side (preference) becuase of the constained advantage the cascade option gives me. (When ever I remove a user all his preferences are also deleted.) ps. Simply changing the DeepCopySericalizer to Serializer fixed this...
|
thoughts? advise? still stuck at serialising entities |
I see this library supports doctrine entities as input to the serialiser.
That example works without relationships. It seems I get into an infinite loop when I have two entities referencing each other.
identity has many preferences.
So either I am doing something wrong, perhaps I should not fetch eager or something. Or this is not possible with this library or I might have found a bug...
https://gist.github.com/basz/898f6981ac12a6a43c3edc19d607a29c
I have pinned it down to the serialiser::serializeData method in the serializer.
The text was updated successfully, but these errors were encountered: