$internalLink =
$category->
getTranslation('internalLink'
);
if (!
$internalLink &&
$linkType &&
$linkType !== CategoryDefinition::LINK_TYPE_EXTERNAL
) { return null;
} switch ($linkType) { case CategoryDefinition::LINK_TYPE_PRODUCT:
return $this->seoUrlReplacer->
generate('frontend.detail.page',
['productId' =>
$internalLink]);
case CategoryDefinition::LINK_TYPE_CATEGORY:
if ($salesChannel !== null &&
$internalLink ===
$salesChannel->
getNavigationCategoryId()) { return $this->seoUrlReplacer->
generate('frontend.home.page'
);
} return $this->seoUrlReplacer->
generate('frontend.navigation.page',
['navigationId' =>
$internalLink]);
case CategoryDefinition::LINK_TYPE_LANDING_PAGE:
return $this->seoUrlReplacer->
generate('frontend.landing.page',
['landingPageId' =>
$internalLink]);
case CategoryDefinition::LINK_TYPE_EXTERNAL:
default:
return $category->
getTranslation('externalLink'
);
}