8000 Fixed problem with multiple occurences of a given namespace. fix #2688 · scp/symfony@4a8f101 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4a8f101

Browse files
committed
Fixed problem with multiple occurences of a given namespace. fix symfony#2688
1 parent 2e8fe92 commit 4a8f101

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
112112
$basename = substr($m->name, strrpos($m->name, '\\') + 1);
113113
$output->writeln(sprintf(' > backing up <comment>%s.php</comment> to <comment>%s.php~</comment>', $basename, $basename));
114114
}
115+
// Getting the metadata for the entity class once more to get the correct path if the namespace has multiple occurrences
116+
$entityMetadata = $manager->getClassMetadata($m->getName(), $input->getOption('path'));
117+
115118
$output->writeln(sprintf(' > generating <comment>%s</comment>', $m->name));
116-
$generator->generate(array($m), $metadata->getPath());
119+
$generator->generate(array($m), $entityMetadata->getPath());
117120

118121
if ($m->customRepositoryClassName && false !== strpos($m->customRepositoryClassName, $metadata->getNamespace())) {
119122
$repoGenerator->writeEntityRepositoryClass($m->customRepositoryClassName, $metadata->getPath());

0 commit comments

Comments
 (0)
0