[DoctrineBundle] cleaned up code
This commit is contained in:
parent
03511dea5c
commit
7395069b60
@ -44,21 +44,14 @@ abstract class AbstractDoctrineExtension extends Extension
|
|||||||
{
|
{
|
||||||
if (isset($objectManager['mappings'])) {
|
if (isset($objectManager['mappings'])) {
|
||||||
foreach ($objectManager['mappings'] as $mappingName => $mappingConfig) {
|
foreach ($objectManager['mappings'] as $mappingName => $mappingConfig) {
|
||||||
if (!isset($mappingConfig['dir'])) {
|
$mappingConfig = array_replace(array(
|
||||||
$mappingConfig['dir'] = false;
|
'dir' => false,
|
||||||
}
|
'type' => false,
|
||||||
if (!isset($mappingConfig['type'])) {
|
'prefix' => false,
|
||||||
$mappingConfig['type'] = false;
|
), $mappingConfig);
|
||||||
}
|
|
||||||
if (!isset($mappingConfig['prefix'])) {
|
|
||||||
$mappingConfig['prefix'] = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$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
|
||||||
if (isset($mappingConfig['is-bundle'])) {
|
|
||||||
$mappingConfig['is_bundle'] = $mappingConfig['is-bundle'];
|
|
||||||
}
|
|
||||||
if (!isset($mappingConfig['is_bundle'])) {
|
if (!isset($mappingConfig['is_bundle'])) {
|
||||||
$mappingConfig['is_bundle'] = !file_exists($mappingConfig['dir']);
|
$mappingConfig['is_bundle'] = !file_exists($mappingConfig['dir']);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user