Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
addDefaultMediaToImageSlider example
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
(
)
)
;
if
(
$sliderItems
=== null
||
(
is_countable
(
$sliderItems
)
? \
count
(
$sliderItems
)
: 0
)
< 1
)
{
return
;
}
$this
->
sortItemsByPosition
(
$sliderItems
)
;