JMSSerializerBundle icon indicating copy to clipboard operation
JMSSerializerBundle copied to clipboard

Serialization of an array of entities with groups not working

Open bagbyte opened this issue 11 years ago • 0 comments

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.

bagbyte avatar Jul 23 '13 11:07 bagbyte