<?php

namespace Autogedal\Labels\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Store\Model\ScopeInterface;

class Config extends AbstractHelper
{
    private const XML_PATH_BASE = 'autogedal_labels/';

    public function isEnabled(string $scopeCode = null): bool
    {
        return $this->getFlag('general/enabled', $scopeCode);
    }

    private function getValue(string $pathSuffix, ?string $scopeCode = null)
    {
        return $this->scopeConfig->getValue(
            self::XML_PATH_BASE . $pathSuffix,
            ScopeInterface::SCOPE_STORE,
            $scopeCode
        );
    }

    private function getFlag(string $pathSuffix, ?string $scopeCode = null): bool
    {
        return $this->scopeConfig->isSetFlag(
            self::XML_PATH_BASE . $pathSuffix,
            ScopeInterface::SCOPE_STORE,
            $scopeCode
        );
    }

}
