Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
LanguageRouteRequestEvent example
$criteria
=
new
Criteria
(
)
;
$criteria
->
setTitle
(
'header::languages'
)
;
$criteria
->
addFilter
(
new
EqualsFilter
(
'language.salesChannelDomains.salesChannelId',
$context
->
getSalesChannel
(
)
->
getId
(
)
)
)
;
$criteria
->
addSorting
(
new
FieldSorting
(
'name', FieldSorting::ASCENDING
)
)
;
$criteria
->
addAssociation
(
'productSearchConfig'
)
;
$apiRequest
=
new
Request
(
)
;
$event
=
new
LanguageRouteRequestEvent
(
$request
,
$apiRequest
,
$context
,
$criteria
)
;
$this
->eventDispatcher->
dispatch
(
$event
)
;
return
$this
->languageRoute->
load
(
$event
->
getStoreApiRequest
(
)
,
$context
,
$criteria
)
->
getLanguages
(
)
;
}
}