private function loadCategoryNames($categoryIds, $storeId)
    {
        $loadCategoryIds = $categoryIds;

        if (isset($this->categoryNameCache[$storeId])) {
            $loadCategoryIds = array_diff($categoryIds, array_keys($this->categoryNameCache[$storeId]));
        }

        $loadCategoryIds  = array_map('intval', $loadCategoryIds);
        $useNameAttribute = $this->getUseNameInSearchAttribute();

        if (!empty($loadCategoryIds) && $useNameAttribute && $useNameAttribute->getId()) {
            $select = $this->prepareCategoryNameSelect($loadCategoryIds, $storeId);
            $entityIdField = $this->getEntityMetaData(CategoryInterface::class)->getIdentifierField();

            foreach ($this->getConnection()->fetchAll($select) as $row) {
                $categoryId = (int) $row[$entityIdField];
                $this->categoryNameCache[$storeId][$categoryId] = '';
                if ((bool) $row['use_name']) {
                    $this->categoryNameCache[$storeId][$categoryId] = $row['name'];
                }
            }
        }

        return isset($this->categoryNameCache[$storeId]) ? $this->categoryNameCache[$storeId] : [];
    }
private function loadCategoryNames($categoryIds, $storeId)
    {
        $loadCategoryIds = $categoryIds;

        if (isset($this->categoryNameCache[$storeId])) {
            $loadCategoryIds = array_diff($categoryIds, array_keys($this->categoryNameCache[$storeId]));
        }

        $loadCategoryIds  = array_map('intval', $loadCategoryIds);
        $useNameAttribute = $this->getUseNameInSearchAttribute();

        if (!empty($loadCategoryIds) && $useNameAttribute && $useNameAttribute->getId()) {
            $select = $this->prepareCategoryNameSelect($loadCategoryIds, $storeId);
            $entityIdField = $this->getEntityMetaData(CategoryInterface::class)->getIdentifierField();

            foreach ($this->getConnection()->fetchAll($select) as $row) {
                $categoryId = (int) $row[$entityIdField];
                $this->categoryNameCache[$storeId][$categoryId] = '';
                if ((bool) $row['use_name']) {
                    $this->categoryNameCache[$storeId][$categoryId] = $row['name'];
                }
            }
        }

        return isset($this->categoryNameCache[$storeId]) ? $this->categoryNameCache[$storeId] : [];
    }
private function loadCategoryNames ( $ categoryIds , $ storeId ) { $ loadCategoryIds = $ categoryIds ; if ( isset ( $ this -> categoryNameCache [ $ storeId ] ) ) { $ loadCategoryIds = array_diff ( $ categoryIds , array_keys ( $ this -> categoryNameCache [ $ storeId ] ) ) ; } $ loadCategoryIds = array_map ( 'intval' , $ loadCategoryIds ) ; $ useNameAttribute = $ this -> getUseNameInSearchAttribute ( ) ; if ( ! empty ( $ loadCategoryIds ) && $ useNameAttribute && $ useNameAttribute -> getId ( ) ) { $ select = $ this -> prepareCategoryNameSelect ( $ loadCategoryIds , $ storeId ) ; $ entityIdField = $ this -> getEntityMetaData ( CategoryInterface :: class ) -> getIdentifierField ( ) ; foreach ( $ this -> getConnection ( ) -> fetchAll ( $ select ) as $ row ) { $ categoryId = ( int ) $ row [ $ entityIdField ] ; $ this -> categoryNameCache [ $ storeId ] [ $ categoryId ] = '' ; if ( ( bool ) $ row [ 'use_name' ] ) { $ this -> categoryNameCache [ $ storeId ] [ $ categoryId ] = $ row [ 'name' ] ; } } } return isset ( $ this -> categoryNameCache [ $ storeId ] ) ? $ this -> categoryNameCache [ $ storeId ] : [ ] ; }
Add some categories name into the cache of names of categories.

@param array $categoryIds Ids of the categories to be added to the cache.
@param int   $storeId     Store Id

@return array
Add some categories name into the cache of names of categories .