src/Webtrees/Module/Sosa/Model/SosaProvider.php
public function getDifferentSosaCountUpToGeneration($gen){
        if(!$this->is_setup) return 0;
        return Database::prepare(
            'SELECT COUNT(DISTINCT majs_i_id) FROM `##maj_sosa`' .
            ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id'.
            ' AND majs_gen <= :gen')
        ->execute(array(
                'tree_id' => $this->tree->getTreeId(), 
                'user_id' => $this->user->getUserId(),
                'gen' => $gen 
        ))->fetchOne() ?: 0;
    }
public function getDifferentSosaCountUpToGeneration($gen){
        if(!$this->is_setup) return 0;
        return Database::prepare(
            'SELECT COUNT(DISTINCT majs_i_id) FROM `##maj_sosa`' .
            ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id'.
            ' AND majs_gen <= :gen')
        ->execute(array(
                'tree_id' => $this->tree->getTreeId(), 
                'user_id' => $this->user->getUserId(),
                'gen' => $gen 
        ))->fetchOne() ?: 0;
    }
public function getDifferentSosaCountUpToGeneration ( $ gen ) { if ( ! $ this -> is_setup ) return 0 ; return Database :: prepare ( 'SELECT COUNT(DISTINCT majs_i_id) FROM `##maj_sosa`' . ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id' . ' AND majs_gen <= :gen' ) -> execute ( array ( 'tree_id' => $ this -> tree -> getTreeId ( ) , 'user_id' => $ this -> user -> getUserId ( ) , 'gen' => $ gen ) ) -> fetchOne ( ) ? : 0 ; }
Get the number of distinct Sosa individual up to a specific generation.

@param number $gen Generation
@return number Number of distinct Sosa individuals up to generation
Get the number of distinct Sosa individual up to a specific generation .