CodeExplorer MediaListItem example
array
$groups,
array
$actives ): FacetResultGroup
{ $results =
[];
foreach ($groups as $group) { $items =
[];
$useMedia = false;
$isActive = false;
foreach ($group->
getOptions() as $option) { $listItem =
new MediaListItem( $option->
getId(),
$option->
getName(),
\
in_array($option->
getId(),
$actives, true
),
$option->
getMedia(),
$option->
getAttributes() );
$isActive =
$isActive ||
$listItem->
isActive();
$useMedia =
$useMedia ||
$listItem->
getMedia() !== null;
$items[] =
$listItem;
}array
$groups,
array
$actives ): FacetResultGroup
{ $results =
[];
foreach ($groups as $group) { $items =
[];
$useMedia = false;
$isActive = false;
foreach ($group->
getOptions() as $option) { $listItem =
new MediaListItem( $option->
getId(),
$option->
getName(),
\
in_array($option->
getId(),
$actives, true
),
$option->
getMedia(),
$option->
getAttributes() );
$isActive =
$isActive ||
$listItem->
isActive();
$useMedia =
$useMedia ||
$listItem->
getMedia() !== null;
$items[] =
$listItem;
} $results =
[];
$fieldName =
$this->queryAliasMapper->
getShortAlias('sFilterProperties'
) ?? 'sFilterProperties';
foreach ($groups as $group) { $items =
[];
$useMedia = false;
$isActive = false;
foreach ($group->
getOptions() as $option) { $listItem =
new MediaListItem( $option->
getId(),
$option->
getName(),
\
in_array($option->
getId(),
$actives),
$option->
getMedia(),
$option->
getAttributes() );
$isActive =
$isActive ||
$listItem->
isActive();
$useMedia =
$useMedia ||
$listItem->
getMedia() !== null;
$items[] =
$listItem;
}