Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createMediaStruct example
&&
$pluginConfiguration
->
getPreviewMedia
(
)
!==
$installedConfiguration
?->
getPreviewMedia
(
)
&&
(
$theme
=== null
||
$theme
->
getPreviewMedia
(
)
=== null
||
basename
(
$installedConfiguration
?->
getPreviewMedia
(
)
?? ''
)
!==
$theme
->
getPreviewMedia
(
)
->
getFileNameIncludingExtension
(
)
)
)
{
$mediaId
= Uuid::
randomHex
(
)
;
$path
=
$pluginConfiguration
->
getPreviewMedia
(
)
;
$mediaItem
=
$this
->
createMediaStruct
(
$path
,
$mediaId
,
$themeFolderId
)
;
if
(
$mediaItem
)
{
$themeData
[
'previewMediaId'
]
=
$mediaId
;
$media
[
$path
]
=
$mediaItem
;
}
}
$baseConfig
=
$pluginConfiguration
->
getThemeConfig
(
)
??
[
]
;
$installedBaseConfig
=
$installedConfiguration
?->
getThemeConfig
(
)
??
[
]
;
$currentThemeMedia
= null;