JMSSerializerBundle
JMSSerializerBundle copied to clipboard
Serialization of an array of entities with groups not working
I'm trying to serialize an array of entities using groups but the filtering is not working, I get the whole list of properties set.
[...] $users = $statement->fetchAll(); $context = new SerializationContext(); $context->setGroups(array('details')); $serializer = SerializerBuilder::create()->build(); $jsonContent = $serializer->serialize($users, 'json', $context);
If I use the serialization on a single object only, it works.