Lines Matching refs:query

90         $query = DB::table('families');
92 $this->whereTrees($query, 'f_file', $trees);
93 $this->whereSearch($query, 'f_gedcom', $search);
95 return $query
115 $query = DB::table('families')
132 $this->whereTrees($query, 'f_file', $trees);
133 $this->whereSearch($query, $field, $search);
135 $query
140 …return $this->paginateQuery($query, $this->familyRowMapper(), GedcomRecord::accessFilter(), $offse…
151 ->join('placelinks', static function (JoinClause $query) {
152 $query
173 $query = DB::table('individuals');
175 $this->whereTrees($query, 'i_file', $trees);
176 $this->whereSearch($query, 'i_gedcom', $search);
178 return $query
198 $query = DB::table('individuals')
207 $this->whereTrees($query, 'i_file', $trees);
208 $this->whereSearch($query, 'n_full', $search);
210 …return $this->paginateQuery($query, $this->individualRowMapper(), GedcomRecord::accessFilter(), $o…
247 $query = DB::table('other')
250 $this->whereTrees($query, 'o_file', $trees);
251 $this->whereSearch($query, 'o_gedcom', $search);
253 …return $this->paginateQuery($query, $this->locationRowMapper(), GedcomRecord::accessFilter(), $off…
268 $query = DB::table('media');
270 $this->whereTrees($query, 'media.m_file', $trees);
271 $this->whereSearch($query, 'm_gedcom', $search);
273 …return $this->paginateQuery($query, $this->mediaRowMapper(), GedcomRecord::accessFilter(), $offset…
288 $query = DB::table('other')
291 $this->whereTrees($query, 'o_file', $trees);
292 $this->whereSearch($query, 'o_gedcom', $search);
294 …return $this->paginateQuery($query, $this->noteRowMapper(), GedcomRecord::accessFilter(), $offset,…
309 $query = DB::table('other')
312 $this->whereTrees($query, 'o_file', $trees);
313 $this->whereSearch($query, 'o_gedcom', $search);
315 …return $this->paginateQuery($query, $this->sharedNoteRowMapper(), GedcomRecord::accessFilter(), $o…
330 $query = DB::table('other')
333 $this->whereTrees($query, 'o_file', $trees);
334 $this->whereSearch($query, 'o_gedcom', $search);
336 …return $this->paginateQuery($query, $this->repositoryRowMapper(), GedcomRecord::accessFilter(), $o…
351 $query = DB::table('sources');
353 $this->whereTrees($query, 's_file', $trees);
354 $this->whereSearch($query, 's_gedcom', $search);
356 …return $this->paginateQuery($query, $this->sourceRowMapper(), GedcomRecord::accessFilter(), $offse…
371 $query = DB::table('sources')
374 $this->whereTrees($query, 's_file', $trees);
375 $this->whereSearch($query, 's_name', $search);
377 …return $this->paginateQuery($query, $this->sourceRowMapper(), GedcomRecord::accessFilter(), $offse…
392 $query = DB::table('name');
394 $this->whereTrees($query, 'n_file', $trees);
395 $this->whereSearch($query, 'n_surname', $search);
397 return $query
417 $query = DB::table('other')
420 $this->whereTrees($query, 'o_file', $trees);
421 $this->whereSearch($query, 'o_gedcom', $search);
423 …return $this->paginateQuery($query, $this->submissionRowMapper(), GedcomRecord::accessFilter(), $o…
438 $query = DB::table('other')
441 $this->whereTrees($query, 'o_file', $trees);
442 $this->whereSearch($query, 'o_gedcom', $search);
444 …return $this->paginateQuery($query, $this->submitterRowMapper(), GedcomRecord::accessFilter(), $of…
459 $query = DB::table('places AS p0')
492 … $query->where('p' . $level . '.p_place', DB::iLike(), '%' . addcslashes($string, '\\%_') . '%');
503 return $this->paginateQuery($query, $row_mapper, $filter, $offset, $limit);
517 $query = DB::table('individuals')
558 $query->join('link AS l1', static function (JoinClause $join): void {
566 $query->join('link AS l2', static function (JoinClause $join): void {
572 $query->join('name AS father_name', static function (JoinClause $join): void {
580 $query->join('link AS l3', static function (JoinClause $join): void {
586 $query->join('name AS mother_name', static function (JoinClause $join): void {
595 $query->join('link AS l4', static function (JoinClause $join): void {
601 $query->join('families AS spouse_families', static function (JoinClause $join): void {
609 $query->join('name AS individual_name', static function (JoinClause $join): void {
617 …$query->join('dates AS date_' . $indi_date, static function (JoinClause $join) use ($indi_date): v…
625 …$query->join('dates AS date_' . $fam_date, static function (JoinClause $join) use ($fam_date): voi…
633 … $query->join('placelinks AS individual_placelinks', static function (JoinClause $join): void {
638 $query->join('places AS individual_places', static function (JoinClause $join): void {
646 … $query->join('placelinks AS family_placelinks', static function (JoinClause $join): void {
651 $query->join('places AS family_places', static function (JoinClause $join): void {
665 $query->where('individual_name.n_givn', '=', $field_value);
668 … $query->where('individual_name.n_givn', DB::iLike(), $field_value . '%');
671 … $query->where('individual_name.n_givn', DB::iLike(), '%' . $field_value . '%');
676 … $this->wherePhonetic($query, 'individual_name.n_soundex_givn_std', $sdx);
679 … $query->where('individual_name.n_givn', DB::iLike(), '%' . $field_value . '%');
686 … $this->wherePhonetic($query, 'individual_name.n_soundex_givn_dm', $sdx);
689 … $query->where('individual_name.n_givn', DB::iLike(), '%' . $field_value . '%');
698 $query->where(function (Builder $query) use ($field_value): void {
699 $query
705 $query->where(function (Builder $query) use ($field_value): void {
706 $query
712 $query->where(function (Builder $query) use ($field_value): void {
713 $query
721 … $this->wherePhonetic($query, 'individual_name.n_soundex_surn_std', $sdx);
724 … $query->where(function (Builder $query) use ($field_value): void {
725 $query
735 … $this->wherePhonetic($query, 'individual_name.n_soundex_surn_dm', $sdx);
738 … $query->where(function (Builder $query) use ($field_value): void {
739 $query
753 $query->where('individuals.i_gedcom', DB::iLike(), $like);
760 $query
770 $query
778 $query->where('individual_places.p_id', '=', $field_value);
781 $query->where('family_places.p_id', '=', $field_value);
788 $query->where($table . '.n_givn', '=', $field_value);
791 $query->where($table . '.n_givn', DB::iLike(), $field_value . '%');
794 … $query->where($table . '.n_givn', DB::iLike(), '%' . $field_value . '%');
799 … $this->wherePhonetic($query, $table . '.n_soundex_givn_std', $sdx);
802 … $query->where($table . '.n_givn', DB::iLike(), '%' . $field_value . '%');
809 … $this->wherePhonetic($query, $table . '.n_soundex_givn_dm', $sdx);
812 … $query->where($table . '.n_givn', DB::iLike(), '%' . $field_value . '%');
820 $query->where($table . '.n_surn', '=', $field_value);
823 $query->where($table . '.n_surn', DB::iLike(), $field_value . '%');
826 … $query->where($table . '.n_surn', DB::iLike(), '%' . $field_value . '%');
831 … $this->wherePhonetic($query, $table . '.n_soundex_surn_std', $sdx);
834 … $query->where($table . '.n_surn', DB::iLike(), '%' . $field_value . '%');
841 … $this->wherePhonetic($query, $table . '.n_soundex_surn_dm', $sdx);
844 … $query->where($table . '.n_surn', DB::iLike(), '%' . $field_value . '%');
854 …$query->where('spouse_families.f_gedcom', DB::iLike(), "%\n1 " . $parts[1] . ' %' . $field_value .…
857 …$query->where('individuals.i_gedcom', DB::iLike(), "%\n1 " . $parts[1] . "%\n2 TYPE %" . $field_va…
861 …$query->where('individuals.i_gedcom', DB::iLike(), "%\n1 " . $parts[1] . '%' . $parts[2] . '%' . $…
865 return $query
983 $query = DB::table('individuals')
987 $this->whereTrees($query, 'i_file', $search_trees);
990 $query->join('placelinks', static function (JoinClause $join): void {
995 $query->join('places', static function (JoinClause $join): void {
1001 $this->wherePhonetic($query, $plac_field, $plac_sdx);
1005 $query->join('name', static function (JoinClause $join): void {
1011 $this->wherePhonetic($query, $givn_field, $givn_sdx);
1012 $this->wherePhonetic($query, $surn_field, $surn_sdx);
1015 return $query
1025 * @param Builder $query Searches the database for the desired records.
1033 …private function paginateQuery(Builder $query, Closure $row_mapper, Closure $row_filter, int $offs… argument
1037 foreach ($query->cursor() as $row) {
1068 * @param Builder $query
1072 … private function whereSearch(Builder $query, Expression|string $column, array $search_terms): void argument
1075 $query->where($column, DB::iLike(), '%' . addcslashes($search_term, '\\%_') . '%');
1082 * @param Builder $query
1086 private function wherePhonetic(Builder $query, $field, string $soundex): void argument
1089 $query->where(function (Builder $query) use ($soundex, $field): void {
1091 $query->orWhere($field, DB::iLike(), '%' . $sdx . '%');
1098 * @param Builder $query
1102 private function whereTrees(Builder $query, string $tree_id_field, array $trees): void argument
1106 $query->whereIn($tree_id_field, $tree_ids);