1
0
mirror of synced 2024-12-05 03:06:05 +03:00

[Embeddables] Improved exception message when embeddables is missing 'class' attribute.

This commit is contained in:
Javier Spagnoletti 2014-09-11 21:10:53 -03:00 committed by Marco Pivetta
parent 655394d433
commit 705a7d2cc2
2 changed files with 14 additions and 0 deletions

View File

@ -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);
}

View File

@ -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