Little return type confusion in LoadClassMetadataEventArgs #11307
Replies: 1 comment 1 reply
-
You should have no issues with this. Yes, the base event class in the If something is still groaning about it, you can just add an inline |
Beta Was this translation helpful? Give feedback.
-
Hi,
i'm on Symfony 6.4 with Doctrine ORM Bundle. I hope I have the right place to discuss my problem.
I'm currently creating an event listener and hook up to doctrine.event_listener.loadClassMetadata with accessing class Doctrine\ORM\Event\LoadClassMetadataEventArgs. Simplified i make this:
so far so unspectacular... but i have a problem with the return value from getClassMetadata().
In Doctrine\ORM\Event\LoadClassMetadataEventArgs the class said it will use/return Doctrine\ORM\Mapping\ClassMetadata:
But the class it extends from - which is Doctrine\Persistence\Event\LoadClassMetadataEventArgs - it will use/return Doctrine\Persistence\Mapping\ClassMetadata, which is not was i looking for:
Now I'm a bit confused. How do I get the expected return I need? These classes are not
(fully) interchangeable!? What am I missing? What am I doing wrong?
Thanks for your help.
Beta Was this translation helpful? Give feedback.
All reactions