public function count()
    {
        $table_name = $this->getEscapedTableName();

        $sql = "SELECT COUNT($table_name.`id`) AS 'row_count' FROM $table_name";

        if ($this->join) {
            $sql .= " $this->join";
        }

        if ($where = $this->getWhere()) {
            $sql .= " WHERE $where";
        }

        return $this->connection->executeFirstCell($sql);
    }
public function count()
    {
        $table_name = $this->getEscapedTableName();

        $sql = "SELECT COUNT($table_name.`id`) AS 'row_count' FROM $table_name";

        if ($this->join) {
            $sql .= " $this->join";
        }

        if ($where = $this->getWhere()) {
            $sql .= " WHERE $where";
        }

        return $this->connection->executeFirstCell($sql);
    }
public function count ( ) { $ table_name = $ this -> getEscapedTableName ( ) ; $ sql = "SELECT COUNT($table_name.`id`) AS 'row_count' FROM $table_name" ; if ( $ this -> join ) { $ sql .= " $this->join" ; } if ( $ where = $ this -> getWhere ( ) ) { $ sql .= " WHERE $where" ; } return $ this -> connection -> executeFirstCell ( $ sql ) ; }
Return number of records that match the given criteria.

@return int
Return number of records that match the given criteria .