public function afterGetCurrentCategory(
        \Magento\Catalog\Model\Layer\Category $layer,
        \Magento\Catalog\Api\Data\CategoryInterface $category
    ) {
        $this->searchContext->setCurrentCategory($category);

        return $category;
    }
public function afterGetCurrentCategory(
        \Magento\Catalog\Model\Layer\Category $layer,
        \Magento\Catalog\Api\Data\CategoryInterface $category
    ) {
        $this->searchContext->setCurrentCategory($category);

        return $category;
    }
public function afterGetCurrentCategory ( \ Magento \ Catalog \ Model \ Layer \ Category $ layer , \ Magento \ Catalog \ Api \ Data \ CategoryInterface $ category ) { $ this -> searchContext -> setCurrentCategory ( $ category ) ; return $ category ; }
Set the current layer category into the Search context after being assigned to the layer.

@SuppressWarnings(PHPMD.UnusedFormalParameter)

@param \Magento\Catalog\Model\Layer\Category       $layer    The layer
@param \Magento\Catalog\Api\Data\CategoryInterface $category Current Category

@return \Magento\Catalog\Model\Layer\Category
Set the current layer category into the Search context after being assigned to the layer .