[Embeddables] Improved exception message when embeddables is missing 'class' attribute.
This commit is contained in:
parent
655394d433
commit
705a7d2cc2
@ -170,6 +170,10 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($embeddableClass['class'])) {
|
||||
throw MappingException::missingEmbeddedClass($property);
|
||||
}
|
||||
|
||||
if (isset($this->embeddablesActiveNesting[$embeddableClass['class']])) {
|
||||
throw MappingException::infiniteEmbeddableNesting($class->name, $property);
|
||||
}
|
||||
|
@ -105,6 +105,16 @@ class MappingException extends \Doctrine\ORM\ORMException
|
||||
return new self("The association mapping '$fieldName' misses the 'sourceEntity' attribute.");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $fieldName
|
||||
*
|
||||
* @return MappingException
|
||||
*/
|
||||
public static function missingEmbeddedClass($fieldName)
|
||||
{
|
||||
return new self("The embed mapping '$fieldName' misses the 'class' attribute.");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $entityName
|
||||
* @param string $fileName
|
||||
|
Loading…
Reference in New Issue
Block a user