Commit 3afc8f79 authored by Jonathan H. Wage's avatar Jonathan H. Wage

Throw exception when entity generator is not set

parent d150f8a6
...@@ -49,6 +49,9 @@ class AnnotationExporter extends AbstractExporter ...@@ -49,6 +49,9 @@ class AnnotationExporter extends AbstractExporter
*/ */
public function exportClassMetadata(ClassMetadataInfo $metadata) public function exportClassMetadata(ClassMetadataInfo $metadata)
{ {
if ( ! $this->_entityGenerator) {
throw new \RuntimeException('For the AnnotationExporter you must set an EntityGenerator instance with the setEntityGenerator() method.');
}
$this->_entityGenerator->setGenerateAnnotations(true); $this->_entityGenerator->setGenerateAnnotations(true);
$this->_entityGenerator->setGenerateStubMethods(false); $this->_entityGenerator->setGenerateStubMethods(false);
$this->_entityGenerator->setRegenerateEntityIfExists(false); $this->_entityGenerator->setRegenerateEntityIfExists(false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment