Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
fetchLanguageChains example
if
(
empty
(
$templates
)
)
{
return
;
}
$route
=
$this
->seoUrlRouteRegistry->
findByRouteName
(
$routeName
)
;
if
(
$route
=== null
)
{
throw
new
\
RuntimeException
(
sprintf
(
'Route by name %s not found',
$routeName
)
)
;
}
$context
= Context::
createDefaultContext
(
)
;
$languageChains
=
$this
->
fetchLanguageChains
(
$context
)
;
$criteria
=
new
Criteria
(
)
;
if
(
Feature::
isActive
(
'v6.6.0.0'
)
)
{
$criteria
->
addFilter
(
new
NandFilter
(
[
new
EqualsFilter
(
'typeId', Defaults::SALES_CHANNEL_TYPE_API
)
]
)
)
;
}
$salesChannels
=
$this
->salesChannelRepository->
search
(
$criteria
,
$context
)
->
getEntities
(
)
;
foreach
(
$templates
as
$config
)
{
$template
=
$config
[
'template'
]
;