mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
No way to rely on fallback in onClassMetadataNotFound #7298
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hlib-kuznetsov on GitHub (Jan 18, 2024).
Bug Report
Summary
To make possible providing missing metadata in
onClassMetadataNotFound(which I belive is the main purpose of this event)Doctrine\Persistence\Mapping\MappingExceptionshould be thrown if driver is not able to load metadata for entity.https://github.com/doctrine/persistence/blob/3.2.x/src/Persistence/Mapping/AbstractClassMetadataFactory.php#L227-L228
But AttributeDriver throws
Doctrine\ORM\Mapping\MappingExceptionwho is not ancestor ofDoctrine\Persistence\Mapping\MappingException, so it seems currenlyonClassMetadataNotFoundis pointlesshttps://github.com/doctrine/orm/blob/2.17.x/lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php#L160
@greg0ire commented on GitHub (Jan 18, 2024):
I think this will be fixed in 3.0: https://github.com/doctrine/orm/pull/7199