Skip to content

Commit

Permalink
Adding support for empty naming configuration directive
Browse files Browse the repository at this point in the history
  • Loading branch information
moufmouf committed May 15, 2018
1 parent 5359a32 commit bb91af9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions DependencyInjection/TdbmExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ public function load(array $configs, ContainerBuilder $container)
$definition->replaceArgument(0, $config['bean_namespace']);
$definition->replaceArgument(1, $config['dao_namespace']);

$definitionNamingStrategy = $container->getDefinition(\TheCodingMachine\TDBM\Utils\DefaultNamingStrategy::class);
$definitionNamingStrategy->addMethodCall('setBeanPrefix', [$config['naming']['bean_prefix']]);
$definitionNamingStrategy->addMethodCall('setBeanSuffix', [$config['naming']['bean_suffix']]);
$definitionNamingStrategy->addMethodCall('setBaseBeanPrefix', [$config['naming']['base_bean_prefix']]);
$definitionNamingStrategy->addMethodCall('setBaseBeanSuffix', [$config['naming']['base_bean_suffix']]);
$definitionNamingStrategy->addMethodCall('setDaoPrefix', [$config['naming']['dao_prefix']]);
$definitionNamingStrategy->addMethodCall('setDaoSuffix', [$config['naming']['dao_suffix']]);
$definitionNamingStrategy->addMethodCall('setBaseDaoPrefix', [$config['naming']['base_dao_prefix']]);
$definitionNamingStrategy->addMethodCall('setBaseDaoSuffix', [$config['naming']['base_dao_suffix']]);
$definitionNamingStrategy->addMethodCall('setExceptions', [$config['naming']['exceptions']]);
if (isset($config['naming'])) {
$definitionNamingStrategy = $container->getDefinition(\TheCodingMachine\TDBM\Utils\DefaultNamingStrategy::class);
$definitionNamingStrategy->addMethodCall('setBeanPrefix', [$config['naming']['bean_prefix']]);
$definitionNamingStrategy->addMethodCall('setBeanSuffix', [$config['naming']['bean_suffix']]);
$definitionNamingStrategy->addMethodCall('setBaseBeanPrefix', [$config['naming']['base_bean_prefix']]);
$definitionNamingStrategy->addMethodCall('setBaseBeanSuffix', [$config['naming']['base_bean_suffix']]);
$definitionNamingStrategy->addMethodCall('setDaoPrefix', [$config['naming']['dao_prefix']]);
$definitionNamingStrategy->addMethodCall('setDaoSuffix', [$config['naming']['dao_suffix']]);
$definitionNamingStrategy->addMethodCall('setBaseDaoPrefix', [$config['naming']['base_dao_prefix']]);
$definitionNamingStrategy->addMethodCall('setBaseDaoSuffix', [$config['naming']['base_dao_suffix']]);
$definitionNamingStrategy->addMethodCall('setExceptions', [$config['naming']['exceptions']]);
}
}
}

0 comments on commit bb91af9

Please sign in to comment.