DDC-1254 - Dont throw exception about missing id in disconnected metadata factory
This commit is contained in:
parent
4796452b07
commit
c87dedbec5
@ -313,6 +313,31 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface
|
|||||||
$this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs);
|
$this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->validateRuntimeMetadata($class, $parent);
|
||||||
|
|
||||||
|
$this->loadedMetadata[$className] = $class;
|
||||||
|
|
||||||
|
$parent = $class;
|
||||||
|
|
||||||
|
if ( ! $class->isMappedSuperclass) {
|
||||||
|
$rootEntityFound = true;
|
||||||
|
array_unshift($visited, $className);
|
||||||
|
}
|
||||||
|
|
||||||
|
$loaded[] = $className;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $loaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate runtime metadata is correctly defined.
|
||||||
|
*
|
||||||
|
* @param ClassMetadata $class
|
||||||
|
* @param ClassMetadata $parent
|
||||||
|
*/
|
||||||
|
protected function validateRuntimeMetadata($class, $parent)
|
||||||
|
{
|
||||||
// Verify & complete identifier mapping
|
// Verify & complete identifier mapping
|
||||||
if ( ! $class->identifier && ! $class->isMappedSuperclass) {
|
if ( ! $class->identifier && ! $class->isMappedSuperclass) {
|
||||||
throw MappingException::identifierRequired($className);
|
throw MappingException::identifierRequired($className);
|
||||||
@ -335,20 +360,6 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface
|
|||||||
// second condition is necessary for mapped superclasses in the middle of an inheritance hierachy
|
// second condition is necessary for mapped superclasses in the middle of an inheritance hierachy
|
||||||
throw MappingException::noInheritanceOnMappedSuperClass($class->name);
|
throw MappingException::noInheritanceOnMappedSuperClass($class->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->loadedMetadata[$className] = $class;
|
|
||||||
|
|
||||||
$parent = $class;
|
|
||||||
|
|
||||||
if ( ! $class->isMappedSuperclass) {
|
|
||||||
$rootEntityFound = true;
|
|
||||||
array_unshift($visited, $className);
|
|
||||||
}
|
|
||||||
|
|
||||||
$loaded[] = $className;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $loaded;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,6 +52,17 @@ class DisconnectedClassMetadataFactory extends ClassMetadataFactory
|
|||||||
return $metadata;
|
return $metadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate runtime metadata is correctly defined.
|
||||||
|
*
|
||||||
|
* @param ClassMetadata $class
|
||||||
|
* @param ClassMetadata $parent
|
||||||
|
*/
|
||||||
|
protected function validateRuntimeMetadata($class, $parent)
|
||||||
|
{
|
||||||
|
// validate nothing
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user