Improving output of doctrine:mapping:info command.

This commit is contained in:
Jonathan H. Wage 2011-03-13 12:49:36 -05:00
parent 843c449c73
commit 138ef0d1ae

View File

@ -58,7 +58,16 @@ EOT
->getMetadataDriverImpl()
->getAllClassNames();
$output->write(sprintf("Found %d entities mapped in entity manager '%s':",
if (!$entityClassNames) {
throw new \Exception(
'You do not have any mapped Doctrine ORM entities for any of your bundles. '.
'Create a class inside the Entity namespace of any of your bundles and provide '.
'mapping information for it with Annotations directly in the classes doc blocks '.
'or with XML/YAML in your bundles Resources/config/doctrine/metadata/orm directory.'
);
}
$output->write(sprintf("Found <info>%d</info> entities mapped in entity manager <info>%s</info>:\n",
count($entityClassNames), $entityManagerName), true);
foreach ($entityClassNames as $entityClassName) {