Fix parent mapping

This commit is contained in:
Antonio J. García Lagar 2013-06-17 21:19:11 +02:00
commit a386ffefe3
7 changed files with 48 additions and 31 deletions

View file

@ -287,6 +287,7 @@ class Configuration implements ConfigurationInterface
->append($this->getSourceNode())
->append($this->getBoostNode())
->append($this->getRoutingNode())
->append($this->getParentNode())
->end()
;
@ -338,13 +339,7 @@ class Configuration implements ConfigurationInterface
->scalarNode('index_options')->end()
->scalarNode('ignore_above')->end()
->scalarNode('position_offset_gap')->end()
->arrayNode('_parent')
->treatNullLike(array())
->children()
->scalarNode('type')->end()
->scalarNode('identifier')->defaultValue('id')->end()
->end()
->end();
;
if (isset($nestings['fields'])) {
$this->addNestedFieldConfig($node, $nestings, 'fields');
@ -516,4 +511,23 @@ class Configuration implements ConfigurationInterface
return $node;
}
/**
* Returns the array node used for "_parent".
*/
protected function getParentNode()
{
$builder = new TreeBuilder();
$node = $builder->root('_parent');
$node
->children()
->scalarNode('type')->end()
->scalarNode('property')->end()
->scalarNode('identifier')->defaultValue('id')->end()
->end()
;
return $node;
}
}