public function getSearchableCategories($storeId, $categoryIds = null, $fromId = 0, $limit = 100)
    {
        /**
         * @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection
         */
        $categoryCollection = $this->categoryCollectionFactory->create();
        $categoryCollection->addIsActiveFilter();
        $select = $categoryCollection->getSelect();

        $this->addIsVisibleInStoreFilter($select, $storeId);

        if ($categoryIds !== null) {
            $select->where('e.entity_id IN (?)', $categoryIds);
        }

        $select->where('e.entity_id > ?', $fromId)
            ->limit($limit)
            ->order('e.entity_id');

        return $this->connection->fetchAll($select);
    }
public function getSearchableCategories($storeId, $categoryIds = null, $fromId = 0, $limit = 100)
    {
        /**
         * @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection
         */
        $categoryCollection = $this->categoryCollectionFactory->create();
        $categoryCollection->addIsActiveFilter();
        $select = $categoryCollection->getSelect();

        $this->addIsVisibleInStoreFilter($select, $storeId);

        if ($categoryIds !== null) {
            $select->where('e.entity_id IN (?)', $categoryIds);
        }

        $select->where('e.entity_id > ?', $fromId)
            ->limit($limit)
            ->order('e.entity_id');

        return $this->connection->fetchAll($select);
    }
public function getSearchableCategories ( $ storeId , $ categoryIds = null , $ fromId = 0 , $ limit = 100 ) { /**
         * @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection
         */ $ categoryCollection = $ this -> categoryCollectionFactory -> create ( ) ; $ categoryCollection -> addIsActiveFilter ( ) ; $ select = $ categoryCollection -> getSelect ( ) ; $ this -> addIsVisibleInStoreFilter ( $ select , $ storeId ) ; if ( $ categoryIds !== null ) { $ select -> where ( 'e.entity_id IN (?)' , $ categoryIds ) ; } $ select -> where ( 'e.entity_id > ?' , $ fromId ) -> limit ( $ limit ) -> order ( 'e.entity_id' ) ; return $ this -> connection -> fetchAll ( $ select ) ; }
Load a bulk of category data.

@param int     $storeId     Store id.
@param string  $categoryIds Product ids filter.
@param integer $fromId      Load product with id greater than.
@param integer $limit       Number of product to get loaded.

@return array
Load a bulk of category data .