Skip to content

Commit

Permalink
Fix model_paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Schaaf authored and Thomas Schaaf committed Feb 13, 2016
1 parent 58b8062 commit d6d99be
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Command/FixturesLoadCommand.php
Expand Up @@ -168,7 +168,7 @@ protected function loadFixtures(InputInterface $input, OutputInterface $output,
return -1;
}

$connectionName = $input->getOption('connection');
$connectionName = $input->getOption('connection') ?: $this->getDefaultConnection();

if ('yml' === $type) {
$loader = $this->getContainer()->get('propel.loader.yaml');
Expand Down
4 changes: 2 additions & 2 deletions DataFixtures/AbstractDataHandler.php
Expand Up @@ -146,8 +146,8 @@ protected function getModelSearchPaths($connectionName)
{
$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;
}
Expand Down
4 changes: 4 additions & 0 deletions DependencyInjection/Configuration.php
Expand Up @@ -158,6 +158,10 @@ protected function addDatabaseSection(ArrayNodeDefinition $node)
->booleanNode('ATTR_EMULATE_PREPARES')->defaultFalse()->end()
->end()
->end()
->arrayNode('model_paths')
->defaultValue(['src', 'vendor'])
->prototype('scalar')->end()
->end()
->arrayNode('settings')
->fixXmlConfig('query', 'queries')
->children()
Expand Down

0 comments on commit d6d99be

Please sign in to comment.