CodeExplorer getMappingIds example
/**
* {@inheritdoc}
*/
public function getProductsCategories(array
$products, ShopContextInterface
$context) { $productIds =
array_map(function DBaseProduct
$product) { return $product->
getId();
},
$products);
$mapping =
$this->
getMapping($productIds);
$ids =
$this->
getMappingIds($mapping);
$categories =
$this->
getList($ids,
$context);
$result =
[];
foreach ($products as $product) { $id =
$product->
getId();
if (!
isset($mapping[$id])) { continue;
} $ids =
explode(',',
$mapping[$id]);