You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 19, 2025. It is now read-only.
This service also executes an SQL query and hydrates the data once in the DTO
But I have a problem with nullable properties, indeed the hydrator will hydrate the null value for these properties, if they are not present in the data array.
I am able to correct the problem by modifying the HydratorMethodsVisitor class at line 110 by replacing return ['$ object->'. $ propertyName. '='. $ inputArrayName. '['. $ escapedName. '] ?? null; '];
by return ['$ object->'. $ propertyName. '='. $ inputArrayName. '['. $ escapedName. '] ?? '. '$ object->'. $ propertyName. ' ?? null; '];
So my question is, shouldn't the hydrator only hydrate properties if it exists in the array, like Laminas Hydrator ?
Should I use my own FileWriterGeneratorStrategy to overcome this problem ?