Closed real-antonin closed 3 years ago
Hello! Which version of Lean Mapper you are using?
Hello! Which version of Lean Mapper you are using?
dev-develop
It's weird :-/ I tried it on latest dev-develop, but everything works fine. Can you try elaborate in your code where error occured? It can be caused by custom EntityReflection or by class LeanMapper\Reflection\Aliases
(or AliasesParser
).
I do not modify the EntityReflection or Aliases classes.
The method that renames DateTime
to App\ORM\Entity\DateTime
is translate
.
https://github.com/Tharos/LeanMapper/blob/f421bad95caab0f14443a6f85d514ff87b2bd9a6/src/LeanMapper/Reflection/PropertyType.php#L45
We create an instance of the PropertyType class here. https://github.com/Tharos/LeanMapper/blob/f421bad95caab0f14443a6f85d514ff87b2bd9a6/src/LeanMapper/Reflection/PropertyFactory.php#L73
It all ends on this line. https://github.com/Tharos/LeanMapper/blob/f421bad95caab0f14443a6f85d514ff87b2bd9a6/src/LeanMapper/Entity.php#L609-L614
Thanks, fixed :)
Hello,
with strict types, I came across an annoying issue related to DateTime. Maybe it's an intention, but I'll ask anyway.
I have an entity.
In this case, if I call
$medaEntity->publish
, I get an exception.The only way to work around this is to overwrite the
publish
property to\Dibi\DateTime
. I found that thePropertyType
class overrides properties according to namespaces, but I would avoid that in this case.