SensioFrameworkExtraBundle icon indicating copy to clipboard operation
SensioFrameworkExtraBundle copied to clipboard

[DoctrineParamConverter] resolve_target_entities

Open kor3k opened this issue 2 years ago • 0 comments

hello,

i am trying to make DoctrineParamConverter follow doctrine.orm.resolve_target_entities config.

afaik the only thing preventing DPC from loading those "resolved" entities is the supports() method, which returns

return !$em->getMetadataFactory()->isTransient($configuration->getClass());

and this resolves to false for "resolved" entites. but this works

try {
    $em->getMetadataFactory()->getMetadataFor($configuration->getClass());
    return true;
} catch(MappingException $e) {
    return false;
}

is there any reason for using ! ->isTransient() and not ->getMetadataFor() ? will there be any unwanted consequences when i change it to the latter?

kor3k avatar Aug 01 '21 17:08 kor3k