Closed
Description
Symfony version(s) affected
7.3.0
Description
When using the ObjectMapper using Class-Level Transformation, I faced an issue related to the source instance.
According to the doc https://symfony.com/doc/current/object_mapper.html#class-level-transformation, the $source
argument should be an instance of App/DTO/LegacyUserData
but it is not the case. It is actually a App/Entity/User
. Due to this, I always receive the following error :
Warning: Undefined property: App\Entity\User::$userId
How to reproduce
To reproduce the issue :
create a src/DTO/LegacyUserData.php
DTO
create an entity class src/Entity/User.php
in a controller, we can do
using XDEBUG here is the result
Am I doing something wrong ?
Possible Solution
No response
Additional Context
No response