protected function generate_count_records_sql(string $wheresql = null) : string {
        $alias = $this->get_table_alias();
        $db = $this->get_db();

        $selectsql = "SELECT COUNT(1) FROM {" . self::TABLE . "} {$alias}";
        $selectsql .= $wheresql ? ' WHERE ' . $wheresql : '';

        return $selectsql;
    }
protected function generate_count_records_sql(string $wheresql = null) : string {
        $alias = $this->get_table_alias();
        $db = $this->get_db();

        $selectsql = "SELECT COUNT(1) FROM {" . self::TABLE . "} {$alias}";
        $selectsql .= $wheresql ? ' WHERE ' . $wheresql : '';

        return $selectsql;
    }
protected function generate_count_records_sql ( string $ wheresql = null ) : string { $ alias = $ this -> get_table_alias ( ) ; $ db = $ this -> get_db ( ) ; $ selectsql = "SELECT COUNT(1) FROM {" . self :: TABLE . "} {$alias}" ; $ selectsql .= $ wheresql ? ' WHERE ' . $ wheresql : '' ; return $ selectsql ; }
Build the SQL to be used in count_records_sql.

@param string|null $wheresql Where conditions for the SQL
@return string
Build the SQL to be used in count_records_sql .