/**
  * Adds inherited fields to the subclass mapping.
  *
  * @param Doctrine\ODM\MongoDB\Mapping\ClassMetadata $subClass
  * @param Doctrine\ODM\MongoDB\Mapping\ClassMetadata $parentClass
  */
 private function addInheritedFields(ClassMetadata $subClass, ClassMetadata $parentClass)
 {
     foreach ($parentClass->fieldMappings as $fieldName => $mapping) {
         if (!isset($mapping['inherited']) && !$parentClass->isMappedSuperclass) {
             $mapping['inherited'] = $parentClass->name;
         }
         if (!isset($mapping['declared'])) {
             $mapping['declared'] = $parentClass->name;
         }
         $subClass->addInheritedFieldMapping($mapping);
     }
     foreach ($parentClass->reflFields as $name => $field) {
         $subClass->reflFields[$name] = $field;
     }
 }