$data =
$this->connection->
fetchAssociative($sql,
[ 'id' => Uuid::
fromHexToBytes($salesChannelId),
]);
if ($data === false
) { throw SalesChannelException::
noContextData($salesChannelId);
} if (isset($session[SalesChannelContextService::ORIGINAL_CONTEXT
])) { $origin =
new AdminSalesChannelApiSource($salesChannelId,
$session[SalesChannelContextService::ORIGINAL_CONTEXT
]);
} else { $origin =
new SalesChannelApiSource($salesChannelId);
} // explode all available languages for the provided sales channel
$languageIds =
$data['sales_channel_language_ids'
] ?
explode(',',
(string) $data['sales_channel_language_ids'
]) :
[];
$languageIds =
array_keys(array_flip($languageIds));
// check which language should be used in the current request (request header set, or context already contains a language - stored in `sales_channel_api_context`)
$defaultLanguageId = Uuid::
fromBytesToHex($data['sales_channel_default_language_id'
]);
$languageChain =
$this->
buildLanguageChain($session,
$defaultLanguageId,
$languageIds);