Doctrine ODM returns proxy object for base class instead of sub-classed document
问题 During my work on providing new functionality to my project, I decided to expand models. I decided to use base class, grouping common methods, with few sub-classes, all kept in a single collection. Base, abstract class: /** * @MongoDB\Document(repositoryClass="EntryRepository") * @MongoDB\MappedSuperclass * @MongoDB\InheritanceType("SINGLE_COLLECTION") * @MongoDB\DiscriminatorField(fieldName="type") * @MongoDB\DiscriminatorMap({"entry"="Application_Model_Entry", "image"="Application_Model