Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getPropertySet example
// Convert product voting
foreach
(
$product
->
getVotes
(
)
as
$vote
)
{
$data
[
'sVoteComments'
]
[
]
=
$this
->
convertVoteStruct
(
$vote
)
;
}
$data
[
'sVoteAverage'
]
=
[
'average' => 0, 'count' => 0
]
;
if
(
$product
->
getVoteAverage
(
)
)
{
$data
[
'sVoteAverage'
]
=
$this
->
convertVoteAverageStruct
(
$product
->
getVoteAverage
(
)
)
;
}
if
(
$product
->
getPropertySet
(
)
)
{
$data
[
'filtergroupID'
]
=
$product
->
getPropertySet
(
)
->
getId
(
)
;
$data
[
'sProperties'
]
=
$this
->
convertPropertySetStruct
(
$product
->
getPropertySet
(
)
)
;
}
foreach
(
$product
->
getDownloads
(
)
as
$download
)
{
$data
[
'sDownloads'
]
[
]
=
[
'id' =>
$download
->
getId
(
)
,
'description' =>
$download
->
getDescription
(
)
,
'filename' =>
$this
->mediaService->
getUrl
(
$download
->
getFile
(
)
)
,
'size' =>
$download
->
getSize
(
)
,
'attributes' =>
$download
->
getAttributes
(
)
,
]
;