// this category has no root, we return the full breadcrumb
if ($salesChannel === null &&
$navigationCategoryId === null
) { return $categoryBreadcrumb;
} $entryPoints =
[ $navigationCategoryId,
];
if ($salesChannel !== null
) { $entryPoints[] =
$salesChannel->
getNavigationCategoryId();
$entryPoints[] =
$salesChannel->
getServiceCategoryId();
$entryPoints[] =
$salesChannel->
getFooterCategoryId();
} $entryPoints =
array_filter($entryPoints);
$keys =
array_keys($categoryBreadcrumb);
foreach ($entryPoints as $entryPoint) { // Check where this category is located in relation to the navigation entry point of the sales channel
$pos =
array_search($entryPoint,
$keys, true
);