/** * Complete and validate type mappings * * @param string $className * @param ClassMetadataInfo $class */ private function completeMappingTypeValidation($className, ClassMetadataInfo $class) { foreach ($class->fieldMappings as $fieldName => $mapping) { if (Type::hasType($mapping['type'])) { continue; } // Support type as a mapped class? if (!$this->hasMetadataFor($mapping['type']) && !$this->getMetadataFor($mapping['type'])) { throw MappingException::fieldTypeNotFound($className, $fieldName, $mapping['type']); } // Mapped classes must have binding node type XML_ELEMENT if ($mapping['node'] !== ClassMetadataInfo::XML_ELEMENT) { throw MappingException::customTypeWithoutNodeElement($className, $fieldName); } } }