src/MVC/CDatabaseModel.php
public function countAll(){
	  $this->db->select('COUNT(id) as countRows')
	           ->from($this->getSource());
             
    $this->db->execute();
    $this->db->setFetchModeClass(__CLASS__);
    $row = $this->db->fetchOne();
    return $row->countRows;
  }
public function countAll(){
	  $this->db->select('COUNT(id) as countRows')
	           ->from($this->getSource());
             
    $this->db->execute();
    $this->db->setFetchModeClass(__CLASS__);
    $row = $this->db->fetchOne();
    return $row->countRows;
  }
Count all rows in database table

@return  int   $row->countRows   Count of rows