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);
$versionId = Defaults::LIVE_VERSION;
if (isset($session[SalesChannelContextService::VERSION_ID
])) { $versionId =
$session[SalesChannelContextService::VERSION_ID
];
} return new Context( $origin,
[],
Uuid::
fromBytesToHex($data['sales_channel_currency_id'
]),
$languageChain,