Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/Writer/DoctrineWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down