Also cleanup fields in properties of objects

This commit is contained in:
Lea Haensenberger 2014-05-05 12:01:05 +02:00
parent eaa9f83997
commit b1d64e358d

View file

@ -574,11 +574,16 @@ class FOSElasticaExtension extends Extension
protected function cleanUpMapping(&$mappings)
{
foreach ($mappings as &$fieldProperties)
if (empty($fieldProperties['fields'])) {
unset($fieldProperties['fields']);
} else {
$this->cleanUpMapping($fieldProperties['fields']);
foreach ($mappings as &$fieldProperties) {
if (empty($fieldProperties['fields'])) {
unset($fieldProperties['fields']);
} else {
$this->cleanUpMapping($fieldProperties['fields']);
}
if (!empty($fieldProperties['properties'])) {
$this->cleanUpMapping($fieldProperties['properties']);
}
}
}
}