Affects Version/s: 1.0.0BETA2
Fix Version/s: 1.0.0BETA2
Environment:Mac OS X, MAMP
There is still a problem with Single Collection Inheritance.
Please consider the following code :
Resulting in the database with :
Now if I do :
then $result is an instance of Stuffs
But if I try :
then $result is an instance of Items
Note that '$a->id' is a string, the same string containing '4d5dd082b53251b84e000000', so :
are semantically equivalent. It seems however that hydration would ignore the DiscriminatorMap in the second example.
However If you do :
You'll get a Stuffs as a result.
Now I tried to find a workaround when you don't know the type of the returned object. My initial intention was to first fetch a document with :
Then I'm testing a property in the objet to see if it's a Stuffs, if it is, I tried an new :
In order to fetch a Stuffs. But ... I still get a *Items"!
So basically, if you do :
You get a Stuffs. But if you do :
You get a Items!