src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php
public function getGeoAnalysis($id, $only_enabled = true) {
        $args = array (
            'gedcom_id' => $this->tree->getTreeId(),
            'ga_id' => $id
        );
        
        $sql = 'SELECT majgd_id, majgd_descr, majgd_sublevel, majgd_map, majgd_toplevel, majgd_useflagsgen, majgd_detailsgen, majgd_status' .
            ' FROM `##maj_geodispersion`' .
            ' WHERE majgd_file = :gedcom_id AND majgd_id=:ga_id';
        if($only_enabled) {
            $sql .= ' AND majgd_status = :status';
            $args['status'] = 'enabled';
        }
        $sql .= ' ORDER BY majgd_descr';
        
        $ga_array = Database::prepare($sql)->execute($args)->fetchOneRow(\PDO::FETCH_ASSOC);
        
        if($ga_array) {
            return $this->loadGeoAnalysisFromRow($ga_array);
        }
        
        return null;            
    }
public function getGeoAnalysis($id, $only_enabled = true) {
        $args = array (
            'gedcom_id' => $this->tree->getTreeId(),
            'ga_id' => $id
        );
        
        $sql = 'SELECT majgd_id, majgd_descr, majgd_sublevel, majgd_map, majgd_toplevel, majgd_useflagsgen, majgd_detailsgen, majgd_status' .
            ' FROM `##maj_geodispersion`' .
            ' WHERE majgd_file = :gedcom_id AND majgd_id=:ga_id';
        if($only_enabled) {
            $sql .= ' AND majgd_status = :status';
            $args['status'] = 'enabled';
        }
        $sql .= ' ORDER BY majgd_descr';
        
        $ga_array = Database::prepare($sql)->execute($args)->fetchOneRow(\PDO::FETCH_ASSOC);
        
        if($ga_array) {
            return $this->loadGeoAnalysisFromRow($ga_array);
        }
        
        return null;            
    }
public function getGeoAnalysis ( $ id , $ only_enabled = true ) { $ args = array ( 'gedcom_id' => $ this -> tree -> getTreeId ( ) , 'ga_id' => $ id ) ; $ sql = 'SELECT majgd_id, majgd_descr, majgd_sublevel, majgd_map, majgd_toplevel, majgd_useflagsgen, majgd_detailsgen, majgd_status' . ' FROM `##maj_geodispersion`' . ' WHERE majgd_file = :gedcom_id AND majgd_id=:ga_id' ; if ( $ only_enabled ) { $ sql .= ' AND majgd_status = :status' ; $ args [ 'status' ] = 'enabled' ; } $ sql .= ' ORDER BY majgd_descr' ; $ ga_array = Database :: prepare ( $ sql ) -> execute ( $ args ) -> fetchOneRow ( \ PDO :: FETCH_ASSOC ) ; if ( $ ga_array ) { return $ this -> loadGeoAnalysisFromRow ( $ ga_array ) ; } return null ; }
Get a geographical analysis by its ID.
The function can only search for only enabled analysis, or all.

@param int $id geodispersion analysis ID
@param bool $only_enabled Search for only enabled geodispersion analysis
@return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoAnalysis|NULL
Get a geographical analysis by its ID . The function can only search for only enabled analysis or all .