$salesChannelRepository =
$this->
getContainer()->
get('sales_channel.repository'
);
$criteria =
(new Criteria()) ->
setIds([$this->
getSalesChannelDomain()->
getSalesChannelId()]) ->
addAssociation('languages'
);
/** @var SalesChannelEntity $originalSalesChannel */
$originalSalesChannel =
$salesChannelRepository->
search($criteria,
$this->context
)->
first();
/** @var LanguageCollection $originalSalesChannelLanguages */
$originalSalesChannelLanguages =
$originalSalesChannel->
getLanguages();
$originalSalesChannelArray =
$originalSalesChannelLanguages->
jsonSerialize();
$languages =
array_map(static fn ($language) =>
['id' =>
$language->
getId()],
$originalSalesChannelArray);
$id = '000000009276457086da48d5b5628f3c';
$data =
[ 'id' =>
$id,
'accessKey' =>
$id,
'name' => 'A totally fake Storefront SalesChannel',
'typeId' => Defaults::SALES_CHANNEL_TYPE_STOREFRONT,
'customerGroupId' => TestDefaults::FALLBACK_CUSTOMER_GROUP,
'currencyId' => Defaults::CURRENCY,
'languages' =>
$languages,