src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php
public function getFilteredGeoAnalysisList($search = null, $order_by = null, $start = 0, $limit = null){
        $res = array();
            
        $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';
        
        $args = array('gedcom_id'=> $this->tree->getTreeId());
        
        if($search) {
            $sql .= ' AND majgd_descr LIKE CONCAT(\'%\', :search, \'%\')';
            $args['search'] = $search;
        }
        
        if ($order_by) {
            $sql .= ' ORDER BY ';
            foreach ($order_by as $key => $value) {
                if ($key > 0) {
                    $sql .= ',';
                }
                
                switch ($value['dir']) {
                    case 'asc':
                        $sql .= $value['column'] . ' ASC ';
                        break;
                    case 'desc':
                        $sql .= $value['column'] . ' DESC ';
                        break;
                }
            }
        } else {
            $sql .= ' ORDER BY majgd_descr ASC';
        }
        
        if ($limit) {
            $sql .= " LIMIT :limit OFFSET :offset";
            $args['limit']  = $limit;
            $args['offset'] = $start;
        }
            
        $data = Database::prepare($sql)->execute($args)->fetchAll(\PDO::FETCH_ASSOC);

        foreach($data as $ga) {
            $res[] = $this->loadGeoAnalysisFromRow($ga);
        }
        
        return $res;
    }
public function getFilteredGeoAnalysisList($search = null, $order_by = null, $start = 0, $limit = null){
        $res = array();
            
        $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';
        
        $args = array('gedcom_id'=> $this->tree->getTreeId());
        
        if($search) {
            $sql .= ' AND majgd_descr LIKE CONCAT(\'%\', :search, \'%\')';
            $args['search'] = $search;
        }
        
        if ($order_by) {
            $sql .= ' ORDER BY ';
            foreach ($order_by as $key => $value) {
                if ($key > 0) {
                    $sql .= ',';
                }
                
                switch ($value['dir']) {
                    case 'asc':
                        $sql .= $value['column'] . ' ASC ';
                        break;
                    case 'desc':
                        $sql .= $value['column'] . ' DESC ';
                        break;
                }
            }
        } else {
            $sql .= ' ORDER BY majgd_descr ASC';
        }
        
        if ($limit) {
            $sql .= " LIMIT :limit OFFSET :offset";
            $args['limit']  = $limit;
            $args['offset'] = $start;
        }
            
        $data = Database::prepare($sql)->execute($args)->fetchAll(\PDO::FETCH_ASSOC);

        foreach($data as $ga) {
            $res[] = $this->loadGeoAnalysisFromRow($ga);
        }
        
        return $res;
    }
public function getFilteredGeoAnalysisList ( $ search = null , $ order_by = null , $ start = 0 , $ limit = null ) { $ res = array ( ) ; $ 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' ; $ args = array ( 'gedcom_id' => $ this -> tree -> getTreeId ( ) ) ; if ( $ search ) { $ sql .= ' AND majgd_descr LIKE CONCAT(\'%\', :search, \'%\')' ; $ args [ 'search' ] = $ search ; } if ( $ order_by ) { $ sql .= ' ORDER BY ' ; foreach ( $ order_by as $ key => $ value ) { if ( $ key > 0 ) { $ sql .= ',' ; } switch ( $ value [ 'dir' ] ) { case 'asc' : $ sql .= $ value [ 'column' ] . ' ASC ' ; break ; case 'desc' : $ sql .= $ value [ 'column' ] . ' DESC ' ; break ; } } } else { $ sql .= ' ORDER BY majgd_descr ASC' ; } if ( $ limit ) { $ sql .= " LIMIT :limit OFFSET :offset" ; $ args [ 'limit' ] = $ limit ; $ args [ 'offset' ] = $ start ; } $ data = Database :: prepare ( $ sql ) -> execute ( $ args ) -> fetchAll ( \ PDO :: FETCH_ASSOC ) ; foreach ( $ data as $ ga ) { $ res [ ] = $ this -> loadGeoAnalysisFromRow ( $ ga ) ; } return $ res ; }
Return the list of geodispersion analysis matching specified criterias.

@param string $search Search criteria in analysis description
@param array $order_by Columns to order by
@param int $start Offset to start with (for pagination)
@param int|null $limit Max number of items to return (for pagination)
@return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoAnalysis[]
Return the list of geodispersion analysis matching specified criterias .