Fix model_paths

This commit is contained in:
Thomas Schaaf 2016-02-13 18:10:46 +01:00
parent 58b80628dd
commit d6d99be87f
3 changed files with 7 additions and 3 deletions

View file

@ -168,7 +168,7 @@ EOT
return -1;
}
$connectionName = $input->getOption('connection');
$connectionName = $input->getOption('connection') ?: $this->getDefaultConnection();
if ('yml' === $type) {
$loader = $this->getContainer()->get('propel.loader.yaml');

View file

@ -146,8 +146,8 @@ abstract class AbstractDataHandler
{
$searchPath = array();
if (!empty($this->datasources[$connectionName]['connection']['model_paths'])) {
$modelPaths = $this->datasources[$connectionName]['connection']['model_paths'];
if (!empty($this->datasources['database']['connections'][$connectionName]['model_paths'])) {
$modelPaths = $this->datasources['database']['connections'][$connectionName]['model_paths'];
foreach ($modelPaths as $modelPath) {
$searchPath[] = $this->getRootDir() . '/../' . $modelPath;
}

View file

@ -158,6 +158,10 @@ class Configuration extends PropelConfiguration
->booleanNode('ATTR_EMULATE_PREPARES')->defaultFalse()->end()
->end()
->end()
->arrayNode('model_paths')
->defaultValue(['src', 'vendor'])
->prototype('scalar')->end()
->end()
->arrayNode('settings')
->fixXmlConfig('query', 'queries')
->children()