Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.0ALPHA2
-
Fix Version/s: 1.0.0BETA2
-
Component/s: Hydration
-
Labels:None
-
Environment:PHP 5.3.1, Doctrine ODM MongoDB 2010-06-22 16:07:10
Description
It seems that SINGLE_COLLECTION inheritance is not implemented?
Method UnitOfWork::getOrCreateDocument calls Mapping\Metadata::newInstance without taking possible discriminator map into account.
The example in the official documentation (http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/inheritance-mapping/en) is not a real test: the object is first created as a child-class instance before being queried through the parent class, so the object is returned without hydration, from the UnitOfWork identityMap cache.
The corresponding code from Doctrine\ORM is in Doctrine\ORM\Internal\Hydration\ObjectHydrator::_getEntity (find class name through discriminator map, if any).
It is just not implemented/finished yet. I will fix the code you mention soon. Thanks, Jon