},
$this->
getSortings($categoryId))));
} /**
* @return CustomSorting[]
*/
private function getSortings(int
$categoryId): array
{ $context =
$this->
get(\Shopware\Bundle\StoreFrontBundle\Service\ContextServiceInterface::
class)->
getShopContext();
return current($this->
get(\Shopware\Bundle\StoreFrontBundle\Service\CustomSortingServiceInterface::
class)->
getSortingsOfCategories([$categoryId],
$context));
} private function getSorting(int
$categoryId, int
$sortingId): ?CustomSorting
{ foreach ($this->
getSortings($categoryId) as $sorting) { if ($sorting->
getId() ===
$sortingId) { return $sorting;
} } return null;
}