<?php

namespace AutoAdmin\Bundle\Cache\Configuration;

use AutoAdmin\Bundle\Admin\Entity\CookieConsent;
use AutoAdmin\Bundle\BrickBuilder\Entity\Brick;
use AutoAdmin\Bundle\Cache\Entity\CacheLog;
use AutoAdmin\Bundle\Content\Entity\Log;
use AutoAdmin\Bundle\Seo\Entity\Redirect;
use AutoAdmin\Bundle\Content\Entity\Domain;
use AutoAdmin\Bundle\Content\Entity\Locale;
use AutoAdmin\Bundle\Content\Entity\Site;

class ConfigManager
{
    private array $config;

    public function __construct(array $config)
    {
        $this->config = $config;
    }

    public function cacheEnabled(): bool
    {
        return $this->config['enabled'];
    }

    public function clearOnFlush(): bool
    {
        return $this->config['clear_on_flush'];
    }

    public function getExcludedEntities(): array
    {
        return [
            CacheLog::class,
            Domain::class,
            Site::class,
            Locale::class,
            Log::class,
            Redirect::class,
            Brick::class,
            CookieConsent::class,
            ...$this->config['excluded_entities']
        ];
    }
}