for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the FOSElasticaBundle package.
*
* (c) FriendsOfSymfony <https://friendsofsymfony.github.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FOS\ElasticaBundle\Configuration;
/**
* Index template configuration class.
* @author Dmitry Balabka <[email protected]>
class IndexTemplateConfig implements IndexConfigInterface
{
use IndexConfigTrait;
* Index name pattern.
* @var string
private $template;
* Constructor expects an array as generated by the Container Configuration builder.
public function __construct(array $config)
$this->elasticSearchName = $config['elasticsearch_name'] ?? $config['name'];
$this->name = $config['name'];
$this->settings = $config['settings'] ?? [];
$this->config = $config['config'];
$this->mapping = $config['mapping'];
if (!isset($config['template'])) {
throw new \InvalidArgumentException('Index template value must be set');
}
$this->template = $config['template'];
* Gets index name pattern.
public function getTemplate(): string
return $this->template;