Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
addMedia example
if
(
$navigation
!== null &&
$navigation
->
isStatic
(
)
)
{
$imageSlider
->
setNavigation
(
$navigation
->
getArrayValue
(
)
)
;
}
$sliderItemsConfig
=
$config
->
get
(
'sliderItems'
)
;
if
(
$sliderItemsConfig
=== null
)
{
return
;
}
if
(
$sliderItemsConfig
->
isStatic
(
)
)
{
foreach
(
$sliderItemsConfig
->
getArrayValue
(
)
as
$sliderItem
)
{
$this
->
addMedia
(
$slot
,
$imageSlider
,
$result
,
$sliderItem
)
;
}
}
if
(
$sliderItemsConfig
->
isDefault
(
)
)
{
foreach
(
$sliderItemsConfig
->
getArrayValue
(
)
as
$sliderItem
)
{
$this
->
addDefaultMediaToImageSlider
(
$imageSlider
,
$sliderItem
)
;
}
}
if
(
$sliderItemsConfig
->
isMapped
(
)
&&
$resolverContext
instanceof EntityResolverContext
)
{
$sliderItems
=
$this
->
resolveEntityValue
(
$resolverContext
->
getEntity
(
)
,
$sliderItemsConfig
->
getStringValue
(
)
)
;