Currently, object instantiation is done through a new new $type() closed to the constructor, which requires having setters or public properties outside the constructor.
Therefore, I propose creating an object mapper so that, regardless of where the fields are, the object is correctly rehydrated.
I have started developing a classMapper that takes mappers via a decorator, similar to how the Symfony serializer might work. Would this be suitable? @clementtalleu
Currently, object instantiation is done through a new
new $type()closed to the constructor, which requires having setters or public properties outside the constructor.Therefore, I propose creating an object mapper so that, regardless of where the fields are, the object is correctly rehydrated.
I have started developing a classMapper that takes mappers via a decorator, similar to how the Symfony serializer might work. Would this be suitable? @clementtalleu