init
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Esun\MultiLocaleTranslation\Model\Config;
|
||||
|
||||
use Magento\Framework\App\Config\ScopeConfigInterface;
|
||||
|
||||
class SkippedFields
|
||||
{
|
||||
private const XML_PATH = 'esun_multilocale_translation/general/skipped_fields';
|
||||
|
||||
public function __construct(
|
||||
private readonly ScopeConfigInterface $scopeConfig
|
||||
) {
|
||||
}
|
||||
|
||||
public function isSkipped(string $entityType, string $field): bool
|
||||
{
|
||||
$value = $this->scopeConfig->getValue(self::XML_PATH);
|
||||
if (!is_string($value) || trim($value) === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$skippedFields = array_filter(array_map('trim', explode(',', $value)));
|
||||
return in_array($entityType . '.' . $field, $skippedFields, true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user