This is my custom class:
class Collection extends \Magento\CatalogSearch\Model\ResourceModel\Search\Collection
{
public function _getSelectCountSql($select = null, $resetLeftJoins = true)
{
$this->_renderFilters();
$countSelect = is_null($select) ? $this->_getClearSelect() : $this->_buildClearSelect($select);
if(count($this->getSelect()->getPart(\Zend_Db_Select::GROUP)) > 0)
{
$countSelect->reset(\Zend_Db_Select::GROUP);
$countSelect->distinct(true);
$group = $this->getSelect()->getPart(\Zend_Db_Select::GROUP);
$countSelect->columns("COUNT(DISTINCT ".implode(", ", $group).")");
} else {
$countSelect->columns('COUNT(*)');
}
return $countSelect;
}
}
Why Im getting Declaration of overridden method should be compatible with parent class error.
How to fix it?