0

Is it possible deserialize to an object with JMS\Serializer?

I don't see n option like the one Symfony Serializer has:

https://symfony.com/doc/current/components/serializer.html#deserializing-in-an-existing-object

$serializer->deserialize($data, Person::class, 'xml', [AbstractNormalizer::OBJECT_TO_POPULATE => $person]);

in JMS\Serializer

public function deserialize(string $data, string $type, string $format, ?DeserializationContext $context = null)
yivi
  • 42,438
  • 18
  • 116
  • 138
Developer
  • 2,731
  • 2
  • 41
  • 71
  • 2
    Seems like it is possible, as described here https://jmsyst.com/libs/serializer/master/cookbook/object_constructor – Ilia Yatsenko Jul 20 '21 at 12:50
  • Does anyone know how to actually implement the `Register ExistingObjectConstructor` part of the link above? – Bokers Apr 11 '22 at 11:24

0 Answers0