public function afterGetProductCollection(
        \Magento\Catalog\Model\Rss\Category $dataProvider,
        \Magento\Catalog\Model\ResourceModel\Product\Collection $collection,
        \Magento\Catalog\Model\Category $category,
        $storeId
    ) {
        $collection->addFieldToFilter('category_ids', $this->getCategoryFilterParam($category));

        return $collection;
    }
public function afterGetProductCollection(
        \Magento\Catalog\Model\Rss\Category $dataProvider,
        \Magento\Catalog\Model\ResourceModel\Product\Collection $collection,
        \Magento\Catalog\Model\Category $category,
        $storeId
    ) {
        $collection->addFieldToFilter('category_ids', $this->getCategoryFilterParam($category));

        return $collection;
    }
public function afterGetProductCollection ( \ Magento \ Catalog \ Model \ Rss \ Category $ dataProvider , \ Magento \ Catalog \ Model \ ResourceModel \ Product \ Collection $ collection , \ Magento \ Catalog \ Model \ Category $ category , $ storeId ) { $ collection -> addFieldToFilter ( 'category_ids' , $ this -> getCategoryFilterParam ( $ category ) ) ; return $ collection ; }
Apply category filter to the collection

@SuppressWarnings(PHPMD.UnusedFormalParameter)

@param \Magento\Catalog\Model\Rss\Category                     $dataProvider Data provider.
@param \Magento\Catalog\Model\ResourceModel\Product\Collection $collection   Product collection.
@param \Magento\Catalog\Model\Category                         $category     Current category.
@param int                                                     $storeId      Store ID.

@return \Magento\Catalog\Model\ResourceModel\Product\Collection
Apply category filter to the collection