0

I use JSM serialization bundle, which is fine, in symfony 2. The deal is that I use some User entity, on which I want to define some display var policy. The strategy is somehow the same for all the projet, but the user entity is searched through many different requests, for instance there are some community->users, or or some session->user, or some comment->owner, and if I define some expose strategy, I guess I have to do it for all the including entities, propagating threw all the parents entities.

For instance, if I have got a community entity, where I include community->owner and community->session->user, I want to be able the strategy only at the user level without adding it to session, and community. Now if i dont the serilization display nothing...

Any suggestions folks?

f_puras
  • 2,521
  • 4
  • 33
  • 38
user2626210
  • 115
  • 5
  • 13
  • why not use Serialization Groups where you can define how to serialize your user based on the context? http://jmsyst.com/libs/serializer/master/cookbook/exclusion_strategies#creating-different-views-of-your-objects – LBA Jun 07 '16 at 10:27
  • it time consumming; and not optimized according to me : because it necessary to write the group notation on each field of the parents entities, if no, doesnt display anything ... my track now is using event and edit slightly event code to enable obect ability to be not only read, but set ... – user2626210 Jun 07 '16 at 11:03

0 Answers0