| 1 | <?php |
||
| 23 | class IndexConfig implements IndexConfigInterface |
||
| 24 | { |
||
| 25 | use IndexConfigTrait; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Indicates if the index should use an alias, allowing an index repopulation to occur |
||
| 29 | * without overwriting the current index. |
||
| 30 | * |
||
| 31 | * @var bool |
||
| 32 | */ |
||
| 33 | private $useAlias = false; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Constructor expects an array as generated by the Container Configuration builder. |
||
| 37 | * |
||
| 38 | * @param string $name |
||
| 39 | * @param TypeConfig[] $types |
||
| 40 | * @param array $config |
||
| 41 | */ |
||
| 42 | 27 | public function __construct($name, array $types, array $config) |
|
| 43 | { |
||
| 44 | 27 | $this->elasticSearchName = isset($config['elasticSearchName']) ? $config['elasticSearchName'] : $name; |
|
| 45 | 27 | $this->name = $name; |
|
| 46 | 27 | $this->settings = isset($config['settings']) ? $config['settings'] : []; |
|
| 47 | 27 | $this->types = $types; |
|
| 48 | 27 | $this->useAlias = isset($config['useAlias']) ? $config['useAlias'] : false; |
|
| 49 | 27 | } |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @return bool |
||
| 53 | */ |
||
| 54 | 13 | public function isUseAlias() |
|
| 58 | } |
||
| 59 |