public function loadCategoryData($storeId, $productIds)
    {
        $select       = $this->getCategoryProductSelect($productIds, $storeId);
        $categoryData = $this->getConnection()->fetchAll($select);

        $categoryIds = [];

        foreach ($categoryData as $categoryDataRow) {
            $categoryIds[] = $categoryDataRow['category_id'];
        }

        $storeCategoryName = $this->loadCategoryNames(array_unique($categoryIds), $storeId);

        foreach ($categoryData as &$categoryDataRow) {
            $categoryDataRow['name'] = '';
            if (isset($storeCategoryName[(int) $categoryDataRow['category_id']])) {
                $categoryDataRow['name'] = $storeCategoryName[(int) $categoryDataRow['category_id']];
            }
        }

        return $categoryData;
    }
public function loadCategoryData($storeId, $productIds)
    {
        $select       = $this->getCategoryProductSelect($productIds, $storeId);
        $categoryData = $this->getConnection()->fetchAll($select);

        $categoryIds = [];

        foreach ($categoryData as $categoryDataRow) {
            $categoryIds[] = $categoryDataRow['category_id'];
        }

        $storeCategoryName = $this->loadCategoryNames(array_unique($categoryIds), $storeId);

        foreach ($categoryData as &$categoryDataRow) {
            $categoryDataRow['name'] = '';
            if (isset($storeCategoryName[(int) $categoryDataRow['category_id']])) {
                $categoryDataRow['name'] = $storeCategoryName[(int) $categoryDataRow['category_id']];
            }
        }

        return $categoryData;
    }
public function loadCategoryData ( $ storeId , $ productIds ) { $ select = $ this -> getCategoryProductSelect ( $ productIds , $ storeId ) ; $ categoryData = $ this -> getConnection ( ) -> fetchAll ( $ select ) ; $ categoryIds = [ ] ; foreach ( $ categoryData as $ categoryDataRow ) { $ categoryIds [ ] = $ categoryDataRow [ 'category_id' ] ; } $ storeCategoryName = $ this -> loadCategoryNames ( array_unique ( $ categoryIds ) , $ storeId ) ; foreach ( $ categoryData as & $ categoryDataRow ) { $ categoryDataRow [ 'name' ] = '' ; if ( isset ( $ storeCategoryName [ ( int ) $ categoryDataRow [ 'category_id' ] ] ) ) { $ categoryDataRow [ 'name' ] = $ storeCategoryName [ ( int ) $ categoryDataRow [ 'category_id' ] ] ; } } return $ categoryData ; }
Load categories data for a list of product ids and a given store.

@param integer $storeId    Store id.
@param array   $productIds Product ids list.

@return array
Load categories data for a list of product ids and a given store .