Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setOptionIds example
$slot
=
new
CmsSlotEntity
(
)
;
$slot
->
setUniqueIdentifier
(
'id'
)
;
$slot
->
setType
(
'buy-box'
)
;
$slot
->
setFieldConfig
(
$fieldConfig
)
;
$variantProduct
=
new
SalesChannelProductEntity
(
)
;
$variantProduct
->
setId
(
$investigatedProductId
)
;
if
(
isset
(
$variantIds
[
0
]
)
)
{
$variantProduct
->
setParentId
(
$productId
)
;
}
$variantProduct
->
setOptionIds
(
[
Uuid::
randomHex
(
)
]
)
;
$resolverContext
=
new
EntityResolverContext
(
$salesChannelContext
,
new
Request
(
)
,
$this
->
createMock
(
SalesChannelProductDefinition::
class
)
,
$variantProduct
)
;
$result
=
new
ElementDataCollection
(
)
;
$buyBoxResolver
=
$this
->
getContainer
(
)
->
get
(
BuyBoxCmsElementResolver::
class
)
;