Answer the question
In order to leave comments, you need to log in
How to serialize an entity in Symfony 2?
There is an entity Countries and Regions.
There is a connected bundle JMSSerializerBundle.
There is a link OneToMany Countries to Regions.
When I extract all countries $data = $em->findAll() and then try to execute $serializer->serialize($data, 'json') then serialization occurs not only for countries but also for all regions tied to them. But I do not need serialization of regions, as performance starts to sag. How to serialize an entity without relationships to other tables?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question