Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CustomerGroupRegistrationSettingsRouteResponse example
$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
)
;
}
}