Hello!
I’m struggling a bit to properly hydrate an object property ( $collaborators )
class MyObject {
/* .. normal fields successfully hydrated with ReflectionHydrator ..*/
protected $collaborators; // The property idk how to hydrate ( should be an array )
/* .. other normal fields .. */
}
the problem is that my input data (from csv) is like:
$data = [
/* .. */
'collaborator_1' = 'foo'
'collaborator_2' = 'bar'
/* .. and more collaborators */
/* .. */
];
The solution i came up with is adding a key ‘collaborators’ directly to $data and fill it with everything that preg_match can find but i feel it can be done better with a Strategy.
Does anyone have any hints?