/** * Get collection size * * @return int */ public function getSize() { if (!$this->_interferWithCountSql) { return parent::getSize(); } if (is_null($this->_totalRecords)) { $sql = $this->getSelectCountSql(); $this->_totalRecords = count($this->getConnection()->fetchAll($sql, $this->_bindParams)); } return intval($this->_totalRecords); }