Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
extractTranslations example
$condition
=
$criteria
->
getCondition
(
$facet
->
getName
(
)
)
;
if
(
$condition
instanceof ProductAttributeCondition
)
{
$actives
=
$condition
->
getValue
(
)
;
}
if
(
!\
is_array
(
$actives
)
)
{
$actives
=
[
$actives
]
;
}
$items
=
array_map
(
function
D
$row
)
use
(
$actives
,
$facet
)
{
$viewName
=
$row
[
$facet
->
getField
(
)
]
;
$translation
=
$this
->
extractTranslations
(
$row
, '__attribute_' .
$facet
->
getField
(
)
)
;
if
(
$translation
!== null
)
{
$viewName
=
$translation
;
}
return
new
ValueListItem
(
$row
[
$facet
->
getField
(
)
]
,
$viewName
, \
in_array
(
$row
[
$facet
->
getField
(
)
]
,
$actives
)
)
;
}
,
$result
)
;
if
(
$facet
->
getMode
(
)
=== ProductAttributeFacet::MODE_RADIO_LIST_RESULT
)
{
return
new
RadioFacetResult
(
$facet
->
getName
(
)
,
$criteria
->
hasCondition
(
$facet
->
getName
(
)
)
,