Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getParentThemeIds example
$baseThemeConfig
=
[
]
;
if
(
$withBase
)
{
$baseTheme
=
$themes
->
filter
(
fn
(
ThemeEntity
$themeEntry
)
=>
$themeEntry
->
getTechnicalName
(
)
===
$this
->baseTheme
)
->
first
(
)
;
\
assert
(
$baseTheme
!== null
)
;
$baseThemeConfig
=
$this
->
mergeStaticConfig
(
$baseTheme
)
;
}
if
(
$theme
->
getParentThemeId
(
)
)
{
$parentThemes
=
$this
->
getParentThemeIds
(
$themes
,
$theme
)
;
foreach
(
$parentThemes
as
$parentTheme
)
{
$configuredParentTheme
=
$this
->
mergeStaticConfig
(
$parentTheme
)
;
$baseThemeConfig
=
array_replace_recursive
(
$baseThemeConfig
,
$configuredParentTheme
)
;
}
}
$configuredTheme
=
$this
->
mergeStaticConfig
(
$theme
)
;
return
array_replace_recursive
(
$baseThemeConfig
,
$configuredTheme
)
;
}