private function getConfigFields(string
$languageId): array
{ if (isset($this->config
[$languageId])) { return $this->config
[$languageId];
} $query =
$this->connection->
createQueryBuilder();
$query->
select('configField.field', 'configField.tokenize', 'configField.ranking', 'LOWER(HEX(config.language_id)) as language_id'
);
$query->
from('product_search_config', 'config'
);
$query->
join('config', 'product_search_config_field', 'configField', 'config.id = configField.product_search_config_id'
);
$query->
andWhere('config.language_id IN (:languageIds)'
);
$query->
andWhere('configField.searchable = 1'
);
$query->
setParameter('languageIds', Uuid::
fromHexToBytesList([$languageId, Defaults::LANGUAGE_SYSTEM
]), ArrayParameterType::STRING
);
/** @var array<int, ConfigField> $all */
$all =
$query->
executeQuery()->
fetchAllAssociative();
$fields =
array_filter($all,
fn (array
$field) =>
$field['language_id'
] ===
$languageId);
if (!
empty($fields)) { $this->config
[$languageId] =
$fields;