public function getDataSourceCount() { if ($this->_dataSource === null) { return 0; } else { if ($this->_allowCustomPaging) { return $this->_virtualCount; } else { return $this->_dataSource->getCount(); } } }