diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index 3a4d080ab..5ddac59f7 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -899,7 +899,8 @@ class ClassMetadataInfo implements ClassMetadata foreach ($this->fieldMappings as $field => $mapping) { if (isset($mapping['declaredField'])) { - $declaringClass = isset($this->embeddedClasses[$field]['declared']) ? $this->embeddedClasses[$field]['declared'] : $this->name; + $declaringClass = isset($this->embeddedClasses[$mapping['declaredField']]['declared']) + ? $this->embeddedClasses[$mapping['declaredField']]['declared'] : $this->name; $this->reflFields[$field] = new ReflectionEmbeddedProperty( $reflService->getAccessibleProperty($declaringClass, $mapping['declaredField']),