Open alvaro-octal opened 2 years ago
No, this is not possible currently. If you have multiple recurring properties (createdAt
, changedAt
, deletedAt
, ...), you could use copyMapping
.
I can see the usefulness though, in a more generic sense: if a mapping exists from source type A to destination type B, automatically apply it. I am afraid that this is not a trivial thing to implement, especially for this case, since we're mapping from a scalar value to an object, which is something that still needs to be implemented as well.
I like the idea and will leave this open as food for thought.
Ok, thanks!
Hi,
I was taking a look at the issues, but haven't found any similar, is there a way to map a string into a DateTime/DateTimeImmutable by default? I mean, I have the following entity:
And by using this mapper it results in a error, because the library is not able to determine a mapper for string to DateTimeImmutable of the
createdAt
property.Of course I can add another
forMember
in order to map the string into aDateTimeImmutable
but seems repetitive to me, is there a way to automate?