Closed alekitto closed 1 year ago
This one's more tricky because of the initialization step
for which Persistence's interface is not sufficient. Most probably we should introduce our own interface.
Offhand, what's your use case for custom metadata factory?
Most probably we should introduce our own interface.
Agree
Offhand, what's your use case for custom metadata factory?
It is mostly used for testing actually: I'm using a DocumentManager with a mocked connection and a custom metadata factory in order to precisely control what is returned from the factory itself
Closing as #2552 got merged
BC Break Report
Summary
Since version 2.5.0, the class metadata factory cannot be overridden.
Previous behavior
The document manager has been instantiated taking the class name from the configuration on document manager construction
Current behavior
Since https://github.com/doctrine/mongodb-odm/commit/5987555a4a2f19125089f0061a978f1d8b9e818f the override is broken as the document manager is wired to the final class
Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory
. To allow overriding via configuration, it should be wired againstDoctrine\Persistence\Mapping\ClassMetadataFactory
interface.How to reproduce