[DoctrineBundle] simplified code
This commit is contained in:
parent
0f5f28c039
commit
71330e91d0
@ -42,13 +42,12 @@ abstract class AbstractDoctrineExtension extends Extension
|
|||||||
*/
|
*/
|
||||||
protected function loadMappingInformation(array $objectManager, ContainerBuilder $container)
|
protected function loadMappingInformation(array $objectManager, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
if (isset($objectManager['mappings'])) {
|
|
||||||
foreach ($objectManager['mappings'] as $mappingName => $mappingConfig) {
|
foreach ($objectManager['mappings'] as $mappingName => $mappingConfig) {
|
||||||
$mappingConfig = array_replace(array(
|
$mappingConfig = array_replace(array(
|
||||||
'dir' => false,
|
'dir' => false,
|
||||||
'type' => false,
|
'type' => false,
|
||||||
'prefix' => false,
|
'prefix' => false,
|
||||||
), $mappingConfig);
|
), (array) $mappingConfig);
|
||||||
|
|
||||||
$mappingConfig['dir'] = $container->getParameterBag()->resolveValue($mappingConfig['dir']);
|
$mappingConfig['dir'] = $container->getParameterBag()->resolveValue($mappingConfig['dir']);
|
||||||
// a bundle configuration is detected by realizing that the specified dir is not absolute and existing
|
// a bundle configuration is detected by realizing that the specified dir is not absolute and existing
|
||||||
@ -81,7 +80,6 @@ abstract class AbstractDoctrineExtension extends Extension
|
|||||||
$this->setMappingDriverAlias($mappingConfig, $mappingName);
|
$this->setMappingDriverAlias($mappingConfig, $mappingName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the alias for this mapping driver.
|
* Register the alias for this mapping driver.
|
||||||
|
Reference in New Issue
Block a user