Papper icon indicating copy to clipboard operation
Papper copied to clipboard

Problem while mapping protected members with different names

Open Alabme opened this issue 9 years ago • 0 comments

Hi. I wanted to map one class to another with protected properties, say: UserA::$firstName to UserB::$givenName.

Papper::createMap('UserA', 'UserB')->forMember('givenName', new MapFrom('firstName'));

But i've got exception saying "Unable to find destination member givenName on type UserB". I'm not sure but I think the problem may be related with getting public methods in: vendor/idr0id/papper/src/Papper/Internal/TypeMapFactory.php:40

ReflectionHelper::getPublicMethods($destReflector, 1),

since it gets only these methods that have one argument so omits all getters.

But maybe I do something wrong :/

Regards, Tomasz Będkowski

Alabme avatar Dec 31 '15 22:12 Alabme