So i don't know the type of an document I want retrieve and thus have no idea how to retrieve this document in a doctrine manner. Normally i would do somethink like that:
$dm->find('User', 12345);
And i should get the User class. But what if I don't know the type of the document? It's stored in document so Doctrine should figure it out. I should simple call
$dm->find(12345); //of course this doesn't work
and Doctrine should look into "type" field in the document and return the User class.
Of course i can do it by hand but maybe there is an Doctrine method for this problem?
So my question is: How to retrieve (using doctrine) the document and instantiate correct class (depending on the "type" field found in the document)?