Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Fabien Somnier 2014-02-03 17:51:23 +01:00
commit 0ae84d56c7
2 changed files with 24 additions and 0 deletions

View file

@ -299,6 +299,7 @@ class Configuration implements ConfigurationInterface
->append($this->getParentNode())
->append($this->getAllNode())
->append($this->getTimestampNode())
->append($this->getTtlNode())
->end()
;
@ -669,4 +670,24 @@ class Configuration implements ConfigurationInterface
return $node;
}
/**
* Returns the array node used for "_ttl"
*/
protected function getTtlNode()
{
$builder = new TreeBuilder();
$node = $builder->root('_ttl');
$node
->children()
->scalarNode('enabled')->defaultValue(true)->end()
->scalarNode('default')->end()
->scalarNode('store')->end()
->scalarNode('index')->end()
->end()
;
return $node;
}
}

View file

@ -249,6 +249,9 @@ class FOSElasticaExtension extends Extension
if (isset($type['_timestamp'])) {
$this->indexConfigs[$indexName]['config']['mappings'][$name]['_timestamp'] = $type['_timestamp'];
}
if (isset($type['_ttl'])) {
$this->indexConfigs[$indexName]['config']['mappings'][$name]['_ttl'] = $type['_ttl'];
}
if (!empty($type['dynamic_templates'])) {
$this->indexConfigs[$indexName]['config']['mappings'][$name]['dynamic_templates'] = array();
foreach ($type['dynamic_templates'] as $templateName => $templateData) {