To get rid of this problem and generate repo classes, you can temporary modify the end of the following file :
symfony\vendor\doctrine\doctrine-bundle\Doctrine\Bundle\DoctrineBundle\Command\generateEntitiesDoctrineCommand.php
if ($m->customRepositoryClassName
&& false !== strpos($m->customRepositoryClassName, $metadata->getNamespace())) {
$repoGenerator->writeEntityRepositoryClass(
$m->customRepositoryClassName, $metadata->getPath());
}
with the following code :
if (true) {
$output->writeln(
sprintf(' > AND Repository <comment>%s</comment>', $m->name . "Repository")
);
$repoGenerator->writeEntityRepositoryClass(
$m->name . "Repository", $metadata->getPath());
}
Some explanations : in this code,
- the if condition is simplified with 'if (true)' (and could finally be completely suppressed if you want)
- $m->customRepositoryClassName is replaced by $m->name."Repository"
- I added some output to be well informed (in the terminal window) when the repo files are generated.
If you don't use the 'if(true)' condition, and want to check things by yourself, you can also add a facultative else case with an output to get well informed in the future :
else {
$output->writeln(sprintf(' > NO repository generated for this class'));
}
After the modifications, you can re-run the command as usual :
php app/console doctrine:generate:entities AcmeStoreBundle
This is a temporary code, because the problem is not very clear for me until now, the only things I see is that it seems to come from $m->customRepositoryClassName which returns an empty string.
So, to find another and definitive solution, a way could be to check the method customRepositoryClassName of the metadata object...