doctrine/mongodb-odm — pull request #481 by DenisGorbachev (2013-01-29 11:47:58+00:00)
Title: Made discriminatorMap annotation unnecessary

Use case:

* XParentDocument in bundle X.
* XChildDocument extends XParentDocument in bundle X.
* YChildDocument extends XParentDocument in bundle Y.

If bundle Y is homemade and bundle X is third-party, a developer can't redefine discriminatorMap on XParentDocument, and thus can't include YChildDocument in it.

This PR solves the issue by storing FQCNs in discriminatorFields instead of arbitrary keys. Also, this PR remaps discriminatorField to an array of parent FQCNs (which, in absence of discriminatorMap, allows to find all parent + children class documents in one query).