Skip to content
Snippets Groups Projects
BaseConfiguration.php 566 B
Newer Older
Pavel's avatar
Pavel committed
<?php

Pavel's avatar
Pavel committed
namespace IQDEV\ElasticSearch\Config;
Pavel's avatar
Pavel committed

use IQDEV\ElasticSearch\Configuration;
use IQDEV\ElasticSearch\Mapping;
Pavel's avatar
Pavel committed

class BaseConfiguration implements Configuration
{
    public function __construct(
        private readonly Mapping $mapping,
    ) {
    }

Pavel's avatar
Pavel committed
    public function getIndexName(): string
    {
        return $_ENV['IQ_ES_PRODUCT_SEARCH_INDEX'];
    }

    public function getMapping(): Mapping
Pavel's avatar
Pavel committed
    {
        return $this->mapping;
Pavel's avatar
Pavel committed
    }
Pavel's avatar
Pavel committed

    public function getSettings(): array
    {
        return include __DIR__.'/product.settings.php';
    }
}