public function addCategoryFilter(\Magento\Catalog\Model\Category $category)
{
$categoryId = $category;
if (is_object($category)) {
$categoryId = $category->getId();
}
$this->addFieldToFilter('category_ids', $categoryId);
$this->_productLimitationFilters['category_ids'] = $categoryId;
return $this;
}