Fix default connection detection when not explicitly set in the configuration

This commit is contained in:
Kévin Gomez 2014-11-21 13:01:36 +00:00
commit 67eeb882e7
2 changed files with 3 additions and 2 deletions

View file

@ -346,7 +346,7 @@ abstract class AbstractCommand extends ContainerAwareCommand
{
$config = $this->getContainer()->getParameter('propel.configuration');
return $config['generator']['defaultConnection'];
return !empty($config['generator']['defaultConnection']) ? $config['generator']['defaultConnection'] : key($config['database']['connections']);
}
/**