1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Merge pull request #891 from spolischook/patch-2

Allow to not generate extra use
This commit is contained in:
Benjamin Eberlei 2013-12-30 00:33:03 -08:00
commit 58c57c50bf

View File

@ -202,9 +202,7 @@ class EntityGenerator
'<?php
<namespace>
use Doctrine\ORM\Mapping as ORM;
<useStatement>
<entityAnnotation>
<entityClassName>
{
@ -380,6 +378,7 @@ public function __construct()
{
$placeHolders = array(
'<namespace>',
'<useStatement>',
'<entityAnnotation>',
'<entityClassName>',
'<entityBody>'
@ -387,6 +386,7 @@ public function __construct()
$replacements = array(
$this->generateEntityNamespace($metadata),
$this->generateEntityUse(),
$this->generateEntityDocBlock($metadata),
$this->generateEntityClassName($metadata),
$this->generateEntityBody($metadata)
@ -568,6 +568,15 @@ public function __construct()
return 'namespace ' . $this->getNamespace($metadata) .';';
}
}
protected function generateEntityUse()
{
if ($this->generateAnnotations) {
return "\n".'use Doctrine\ORM\Mapping as ORM;'."\n";
} else {
return "";
}
}
/**
* @param ClassMetadataInfo $metadata