Skip to content
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

Recursion groups, serializing properties in entities #329

Closed
YoruNoHikage opened this issue Aug 28, 2014 · 6 comments
Closed

Recursion groups, serializing properties in entities #329

YoruNoHikage opened this issue Aug 28, 2014 · 6 comments

Comments

@YoruNoHikage
Copy link

As pointed out in this thread http://stackoverflow.com/questions/12746455/jmsserializerbundle-serialization-groups-in-entities-with-relations there's no way I know to make a difference between groups in the main entity and its relations.

The changes brought by the answer are perfect to do so, but the author didn't submit his code here.

How should I do, is there a better way to do what I want or to implement this changes ? Should we open a pull request ? (I forked this repo and applied the changes in it as a temporary solution).

@wizardz
Copy link

wizardz commented Oct 26, 2014

Hi guys, any chances to get your attention to this issue? Are we missing some existing solution?

@lopsided
Copy link

This would be a really useful addition to the bundle. Check out the proposed usage here by @andreasferber :
andreasferber@60582e7

Unless there is a suitable workaround? How else can you serialize User->Friends(User) without pulling in all the same fields for all the friends as you have for the original user?

@lopsided
Copy link

The way I'm working around this at the moment is to create a new model class (not persisted) for Friend containing only the properties that I want to be serialized and then changing my getFriends() method to convert the returned User objects into an array of my new Friend objects. Feels a bit messy.

@adrienbrault
Copy link
Contributor

Have you seen #170 ?

@lopsided
Copy link

@adrienbrault No I hadn't! Thanks for the ref I'll keep an eye on that one too.

@YoruNoHikage
Copy link
Author

@adrienbrault Wow, didn't see that. It seems to do the same thing. I think this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants