diff --git a/src/Writer/DoctrineWriter.php b/src/Writer/DoctrineWriter.php index fca7cc38..a56d0248 100644 --- a/src/Writer/DoctrineWriter.php +++ b/src/Writer/DoctrineWriter.php @@ -135,13 +135,11 @@ public function prepare() */ protected function getNewInstance() { - $className = $this->entityMetadata->getName(); - - if (class_exists($className) === false) { - throw new \Exception('Unable to create new instance of ' . $className); + if (class_exists($this->entityName) === false) { + throw new \Exception('Unable to create new instance of ' . $this->entityName); } - return new $className; + return new $this->entityName; } /**