// see http://stackoverflow.com/questions/8321620/array-unique-vs-array-flip
$numbers =
array_keys(array_flip($numbers));
$products =
$this->productGateway->
getList($numbers,
$context);
$covers =
$this->mediaService->
getCovers($products,
$context);
$graduatedPrices =
$this->graduatedPricesService->
getList($products,
$context);
$cheapestPrices =
$this->cheapestPriceService->
getList($products,
$context);
$voteAverages =
$this->voteService->
getAverages($products,
$context);
$categories =
$this->categoryService->
getProductsCategories($products,
$context);
$manufacturerCovers =
$this->mediaService->
getList($this->
getManufacturerCoverIds($products),
$context);
$result =
[];
foreach ($numbers as $number) { if (!\
array_key_exists($number,
$products)) { continue;
} $product =
$products[$number];