public function getCount()
{
if ($this->_dataSource === null) {
return 0;
}
if (!$this->_allowPaging) {
return $this->getDataSourceCount();
}
if (!$this->_allowCustomPaging && $this->getIsLastPage()) {
return $this->getDataSourceCount() - $this->getFirstIndexInPage();
}
return $this->_pageSize;
}