public function getDecorated(): AbstractCustomerGroupRegistrationSettingsRoute
{ throw new DecorationPatternException(self::
class);
} #[Route(path: '/store-api/customer-group-registration/config/{customerGroupId}', name: 'store-api.customer-group-registration.config', methods: ['GET'])]
public function load(string
$customerGroupId, SalesChannelContext
$context): CustomerGroupRegistrationSettingsRouteResponse
{ $criteria =
new Criteria([$customerGroupId]);
$criteria->
addFilter(new EqualsFilter('registrationActive', 1
));
$criteria->
addFilter(new EqualsFilter('registrationSalesChannels.id',
$context->
getSalesChannel()->
getId()));
$result =
$this->customerGroupRepository->
search($criteria,
$context->
getContext());
if ($result->
getTotal() === 0
) { throw CustomerException::
customerGroupRegistrationConfigurationNotFound($customerGroupId);
} $customerGroup =
$result->
first();
\
assert($customerGroup instanceof CustomerGroupEntity
);
return new CustomerGroupRegistrationSettingsRouteResponse($customerGroup);
}