| Conditions | 107 |
| Paths | > 20000 |
| Total Lines | 428 |
| Code Lines | 312 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 516 | public function searchIndividualsAdvanced(array $trees, array $fields, array $modifiers): Collection |
||
| 517 | { |
||
| 518 | $fields = array_filter($fields, static fn (string $x): bool => $x !== ''); |
||
| 519 | |||
| 520 | $query = DB::table('individuals') |
||
| 521 | ->select(['individuals.*']) |
||
| 522 | ->distinct(); |
||
| 523 | |||
| 524 | $this->whereTrees($query, 'i_file', $trees); |
||
| 525 | |||
| 526 | // Join the following tables |
||
| 527 | $father_name = false; |
||
| 528 | $mother_name = false; |
||
| 529 | $spouse_family = false; |
||
| 530 | $indi_name = false; |
||
| 531 | $indi_dates = []; |
||
| 532 | $fam_dates = []; |
||
| 533 | $indi_plac = false; |
||
| 534 | $fam_plac = false; |
||
| 535 | |||
| 536 | foreach ($fields as $field_name => $field_value) { |
||
| 537 | if (str_starts_with($field_name, 'FATHER:NAME')) { |
||
| 538 | $father_name = true; |
||
| 539 | } elseif (str_starts_with($field_name, 'MOTHER:NAME')) { |
||
| 540 | $mother_name = true; |
||
| 541 | } elseif (str_starts_with($field_name, 'INDI:NAME:GIVN')) { |
||
| 542 | $indi_name = true; |
||
| 543 | } elseif (str_starts_with($field_name, 'INDI:NAME:SURN')) { |
||
| 544 | $indi_name = true; |
||
| 545 | } elseif (str_starts_with($field_name, 'FAM:')) { |
||
| 546 | $spouse_family = true; |
||
| 547 | if (str_ends_with($field_name, ':DATE')) { |
||
| 548 | $fam_dates[] = explode(':', $field_name)[1]; |
||
| 549 | } elseif (str_ends_with($field_name, ':PLAC')) { |
||
| 550 | $fam_plac = true; |
||
| 551 | } |
||
| 552 | } elseif (str_starts_with($field_name, 'INDI:')) { |
||
| 553 | if (str_ends_with($field_name, ':DATE')) { |
||
| 554 | $indi_dates[] = explode(':', $field_name)[1]; |
||
| 555 | } elseif (str_ends_with($field_name, ':PLAC')) { |
||
| 556 | $indi_plac = true; |
||
| 557 | } |
||
| 558 | } |
||
| 559 | } |
||
| 560 | |||
| 561 | if ($father_name || $mother_name) { |
||
| 562 | $query->join('link AS l1', static function (JoinClause $join): void { |
||
| 563 | $join |
||
| 564 | ->on('l1.l_file', '=', 'individuals.i_file') |
||
| 565 | ->on('l1.l_from', '=', 'individuals.i_id') |
||
| 566 | ->where('l1.l_type', '=', 'FAMC'); |
||
| 567 | }); |
||
| 568 | |||
| 569 | if ($father_name) { |
||
| 570 | $query->join('link AS l2', static function (JoinClause $join): void { |
||
| 571 | $join |
||
| 572 | ->on('l2.l_file', '=', 'l1.l_file') |
||
| 573 | ->on('l2.l_from', '=', 'l1.l_to') |
||
| 574 | ->where('l2.l_type', '=', 'HUSB'); |
||
| 575 | }); |
||
| 576 | $query->join('name AS father_name', static function (JoinClause $join): void { |
||
| 577 | $join |
||
| 578 | ->on('father_name.n_file', '=', 'l2.l_file') |
||
| 579 | ->on('father_name.n_id', '=', 'l2.l_to'); |
||
| 580 | }); |
||
| 581 | } |
||
| 582 | |||
| 583 | if ($mother_name) { |
||
| 584 | $query->join('link AS l3', static function (JoinClause $join): void { |
||
| 585 | $join |
||
| 586 | ->on('l3.l_file', '=', 'l1.l_file') |
||
| 587 | ->on('l3.l_from', '=', 'l1.l_to') |
||
| 588 | ->where('l3.l_type', '=', 'WIFE'); |
||
| 589 | }); |
||
| 590 | $query->join('name AS mother_name', static function (JoinClause $join): void { |
||
| 591 | $join |
||
| 592 | ->on('mother_name.n_file', '=', 'l3.l_file') |
||
| 593 | ->on('mother_name.n_id', '=', 'l3.l_to'); |
||
| 594 | }); |
||
| 595 | } |
||
| 596 | } |
||
| 597 | |||
| 598 | if ($spouse_family) { |
||
| 599 | $query->join('link AS l4', static function (JoinClause $join): void { |
||
| 600 | $join |
||
| 601 | ->on('l4.l_file', '=', 'individuals.i_file') |
||
| 602 | ->on('l4.l_from', '=', 'individuals.i_id') |
||
| 603 | ->where('l4.l_type', '=', 'FAMS'); |
||
| 604 | }); |
||
| 605 | $query->join('families AS spouse_families', static function (JoinClause $join): void { |
||
| 606 | $join |
||
| 607 | ->on('spouse_families.f_file', '=', 'l4.l_file') |
||
| 608 | ->on('spouse_families.f_id', '=', 'l4.l_to'); |
||
| 609 | }); |
||
| 610 | } |
||
| 611 | |||
| 612 | if ($indi_name) { |
||
| 613 | $query->join('name AS individual_name', static function (JoinClause $join): void { |
||
| 614 | $join |
||
| 615 | ->on('individual_name.n_file', '=', 'individuals.i_file') |
||
| 616 | ->on('individual_name.n_id', '=', 'individuals.i_id'); |
||
| 617 | }); |
||
| 618 | } |
||
| 619 | |||
| 620 | foreach (array_unique($indi_dates) as $indi_date) { |
||
| 621 | $query->join('dates AS date_' . $indi_date, static function (JoinClause $join) use ($indi_date): void { |
||
| 622 | $join |
||
| 623 | ->on('date_' . $indi_date . '.d_file', '=', 'individuals.i_file') |
||
| 624 | ->on('date_' . $indi_date . '.d_gid', '=', 'individuals.i_id'); |
||
| 625 | }); |
||
| 626 | } |
||
| 627 | |||
| 628 | foreach (array_unique($fam_dates) as $fam_date) { |
||
| 629 | $query->join('dates AS date_' . $fam_date, static function (JoinClause $join) use ($fam_date): void { |
||
| 630 | $join |
||
| 631 | ->on('date_' . $fam_date . '.d_file', '=', 'spouse_families.f_file') |
||
| 632 | ->on('date_' . $fam_date . '.d_gid', '=', 'spouse_families.f_id'); |
||
| 633 | }); |
||
| 634 | } |
||
| 635 | |||
| 636 | if ($indi_plac) { |
||
| 637 | $query->join('placelinks AS individual_placelinks', static function (JoinClause $join): void { |
||
| 638 | $join |
||
| 639 | ->on('individual_placelinks.pl_file', '=', 'individuals.i_file') |
||
| 640 | ->on('individual_placelinks.pl_gid', '=', 'individuals.i_id'); |
||
| 641 | }); |
||
| 642 | $query->join('places AS individual_places', static function (JoinClause $join): void { |
||
| 643 | $join |
||
| 644 | ->on('individual_places.p_file', '=', 'individual_placelinks.pl_file') |
||
| 645 | ->on('individual_places.p_id', '=', 'individual_placelinks.pl_p_id'); |
||
| 646 | }); |
||
| 647 | } |
||
| 648 | |||
| 649 | if ($fam_plac) { |
||
| 650 | $query->join('placelinks AS familyl_placelinks', static function (JoinClause $join): void { |
||
| 651 | $join |
||
| 652 | ->on('familyl_placelinks.pl_file', '=', 'individuals.i_file') |
||
| 653 | ->on('familyl_placelinks.pl_gid', '=', 'individuals.i_id'); |
||
| 654 | }); |
||
| 655 | $query->join('places AS family_places', static function (JoinClause $join): void { |
||
| 656 | $join |
||
| 657 | ->on('family_places.p_file', '=', 'familyl_placelinks.pl_file') |
||
| 658 | ->on('family_places.p_id', '=', 'familyl_placelinks.pl_p_id'); |
||
| 659 | }); |
||
| 660 | } |
||
| 661 | |||
| 662 | foreach ($fields as $field_name => $field_value) { |
||
| 663 | $parts = explode(':', $field_name . ':::'); |
||
| 664 | if (str_starts_with($field_name, 'INDI:NAME:')) { |
||
| 665 | switch ($field_name) { |
||
| 666 | case 'INDI:NAME:GIVN': |
||
| 667 | switch ($modifiers[$field_name]) { |
||
| 668 | case 'EXACT': |
||
| 669 | $query->where('individual_name.n_givn', '=', $field_value); |
||
| 670 | break; |
||
| 671 | case 'BEGINS': |
||
| 672 | $query->where('individual_name.n_givn', $this->iLike(), $field_value . '%'); |
||
| 673 | break; |
||
| 674 | case 'CONTAINS': |
||
| 675 | $query->where('individual_name.n_givn', $this->iLike(), '%' . $field_value . '%'); |
||
| 676 | break; |
||
| 677 | case 'SDX_STD': |
||
| 678 | $sdx = Soundex::russell($field_value); |
||
| 679 | if ($sdx !== '') { |
||
| 680 | $this->wherePhonetic($query, 'individual_name.n_soundex_givn_std', $sdx); |
||
| 681 | } else { |
||
| 682 | // No phonetic content? Use a substring match |
||
| 683 | $query->where('individual_name.n_givn', $this->iLike(), '%' . $field_value . '%'); |
||
| 684 | } |
||
| 685 | break; |
||
| 686 | case 'SDX': // SDX uses DM by default. |
||
| 687 | case 'SDX_DM': |
||
| 688 | $sdx = Soundex::daitchMokotoff($field_value); |
||
| 689 | if ($sdx !== '') { |
||
| 690 | $this->wherePhonetic($query, 'individual_name.n_soundex_givn_dm', $sdx); |
||
| 691 | } else { |
||
| 692 | // No phonetic content? Use a substring match |
||
| 693 | $query->where('individual_name.n_givn', $this->iLike(), '%' . $field_value . '%'); |
||
| 694 | } |
||
| 695 | break; |
||
| 696 | } |
||
| 697 | unset($fields[$field_name]); |
||
| 698 | break; |
||
| 699 | case 'INDI:NAME:SURN': |
||
| 700 | switch ($modifiers[$field_name]) { |
||
| 701 | case 'EXACT': |
||
| 702 | $query->where(function (Builder $query) use ($field_value): void { |
||
| 703 | $query |
||
| 704 | ->where('individual_name.n_surn', '=', $field_value) |
||
| 705 | ->orWhere('individual_name.n_surname', '=', $field_value); |
||
| 706 | }); |
||
| 707 | break; |
||
| 708 | case 'BEGINS': |
||
| 709 | $query->where(function (Builder $query) use ($field_value): void { |
||
| 710 | $query |
||
| 711 | ->where('individual_name.n_surn', $this->iLike(), $field_value . '%') |
||
| 712 | ->orWhere('individual_name.n_surname', $this->iLike(), $field_value . '%'); |
||
| 713 | }); |
||
| 714 | break; |
||
| 715 | case 'CONTAINS': |
||
| 716 | $query->where(function (Builder $query) use ($field_value): void { |
||
| 717 | $query |
||
| 718 | ->where('individual_name.n_surn', $this->iLike(), '%' . $field_value . '%') |
||
| 719 | ->orWhere('individual_name.n_surname', $this->iLike(), '%' . $field_value . '%'); |
||
| 720 | }); |
||
| 721 | break; |
||
| 722 | case 'SDX_STD': |
||
| 723 | $sdx = Soundex::russell($field_value); |
||
| 724 | if ($sdx !== '') { |
||
| 725 | $this->wherePhonetic($query, 'individual_name.n_soundex_surn_std', $sdx); |
||
| 726 | } else { |
||
| 727 | // No phonetic content? Use a substring match |
||
| 728 | $query->where(function (Builder $query) use ($field_value): void { |
||
| 729 | $query |
||
| 730 | ->where('individual_name.n_surn', $this->iLike(), '%' . $field_value . '%') |
||
| 731 | ->orWhere('individual_name.n_surname', $this->iLike(), '%' . $field_value . '%'); |
||
| 732 | }); |
||
| 733 | } |
||
| 734 | break; |
||
| 735 | case 'SDX': // SDX uses DM by default. |
||
| 736 | case 'SDX_DM': |
||
| 737 | $sdx = Soundex::daitchMokotoff($field_value); |
||
| 738 | if ($sdx !== '') { |
||
| 739 | $this->wherePhonetic($query, 'individual_name.n_soundex_surn_dm', $sdx); |
||
| 740 | } else { |
||
| 741 | // No phonetic content? Use a substring match |
||
| 742 | $query->where(function (Builder $query) use ($field_value): void { |
||
| 743 | $query |
||
| 744 | ->where('individual_name.n_surn', $this->iLike(), '%' . $field_value . '%') |
||
| 745 | ->orWhere('individual_name.n_surname', $this->iLike(), '%' . $field_value . '%'); |
||
| 746 | }); |
||
| 747 | } |
||
| 748 | break; |
||
| 749 | } |
||
| 750 | unset($fields[$field_name]); |
||
| 751 | break; |
||
| 752 | case 'INDI:NAME:NICK': |
||
| 753 | case 'INDI:NAME:_MARNM': |
||
| 754 | case 'INDI:NAME:_HEB': |
||
| 755 | case 'INDI:NAME:_AKA': |
||
| 756 | $like = "%\n1 NAME%\n2 " . $parts[2] . ' %' . preg_quote($field_value, '/') . '%'; |
||
| 757 | $query->where('individuals.i_gedcom', $this->iLike(), $like); |
||
| 758 | break; |
||
| 759 | } |
||
| 760 | } elseif (str_starts_with($field_name, 'INDI:') && str_ends_with($field_name, ':DATE')) { |
||
| 761 | $date = new Date($field_value); |
||
| 762 | if ($date->isOK()) { |
||
| 763 | $delta = 365 * (int) ($modifiers[$field_name] ?? 0); |
||
| 764 | $query |
||
| 765 | ->where('date_' . $parts[1] . '.d_fact', '=', $parts[1]) |
||
| 766 | ->where('date_' . $parts[1] . '.d_julianday1', '>=', $date->minimumJulianDay() - $delta) |
||
| 767 | ->where('date_' . $parts[1] . '.d_julianday2', '<=', $date->maximumJulianDay() + $delta); |
||
| 768 | } |
||
| 769 | unset($fields[$field_name]); |
||
| 770 | } elseif (str_starts_with($field_name, 'FAM:') && str_ends_with($field_name, ':DATE')) { |
||
| 771 | $date = new Date($field_value); |
||
| 772 | if ($date->isOK()) { |
||
| 773 | $delta = 365 * (int) ($modifiers[$field_name] ?? 0); |
||
| 774 | $query |
||
| 775 | ->where('date_' . $parts[1] . '.d_fact', '=', $parts[1]) |
||
| 776 | ->where('date_' . $parts[1] . '.d_julianday1', '>=', $date->minimumJulianDay() - $delta) |
||
| 777 | ->where('date_' . $parts[1] . '.d_julianday2', '<=', $date->maximumJulianDay() + $delta); |
||
| 778 | } |
||
| 779 | unset($fields[$field_name]); |
||
| 780 | } elseif (str_starts_with($field_name, 'INDI:') && str_ends_with($field_name, ':PLAC')) { |
||
| 781 | // SQL can only link a place to a person/family, not to an event. |
||
| 782 | $query->where('individual_places.p_place', $this->iLike(), '%' . $field_value . '%'); |
||
| 783 | } elseif (str_starts_with($field_name, 'FAM:') && str_ends_with($field_name, ':PLAC')) { |
||
| 784 | // SQL can only link a place to a person/family, not to an event. |
||
| 785 | $query->where('family_places.p_place', $this->iLike(), '%' . $field_value . '%'); |
||
| 786 | } elseif (str_starts_with($field_name, 'MOTHER:NAME:') || str_starts_with($field_name, 'FATHER:NAME:')) { |
||
| 787 | $table = str_starts_with($field_name, 'FATHER:NAME:') ? 'father_name' : 'mother_name'; |
||
| 788 | switch ($parts[2]) { |
||
| 789 | case 'GIVN': |
||
| 790 | switch ($modifiers[$field_name]) { |
||
| 791 | case 'EXACT': |
||
| 792 | $query->where($table . '.n_givn', '=', $field_value); |
||
| 793 | break; |
||
| 794 | case 'BEGINS': |
||
| 795 | $query->where($table . '.n_givn', $this->iLike(), $field_value . '%'); |
||
| 796 | break; |
||
| 797 | case 'CONTAINS': |
||
| 798 | $query->where($table . '.n_givn', $this->iLike(), '%' . $field_value . '%'); |
||
| 799 | break; |
||
| 800 | case 'SDX_STD': |
||
| 801 | $sdx = Soundex::russell($field_value); |
||
| 802 | if ($sdx !== '') { |
||
| 803 | $this->wherePhonetic($query, $table . '.n_soundex_givn_std', $sdx); |
||
| 804 | } else { |
||
| 805 | // No phonetic content? Use a substring match |
||
| 806 | $query->where($table . '.n_givn', $this->iLike(), '%' . $field_value . '%'); |
||
| 807 | } |
||
| 808 | break; |
||
| 809 | case 'SDX': // SDX uses DM by default. |
||
| 810 | case 'SDX_DM': |
||
| 811 | $sdx = Soundex::daitchMokotoff($field_value); |
||
| 812 | if ($sdx !== '') { |
||
| 813 | $this->wherePhonetic($query, $table . '.n_soundex_givn_dm', $sdx); |
||
| 814 | } else { |
||
| 815 | // No phonetic content? Use a substring match |
||
| 816 | $query->where($table . '.n_givn', $this->iLike(), '%' . $field_value . '%'); |
||
| 817 | } |
||
| 818 | break; |
||
| 819 | } |
||
| 820 | break; |
||
| 821 | case 'SURN': |
||
| 822 | switch ($modifiers[$field_name]) { |
||
| 823 | case 'EXACT': |
||
| 824 | $query->where($table . '.n_surn', '=', $field_value); |
||
| 825 | break; |
||
| 826 | case 'BEGINS': |
||
| 827 | $query->where($table . '.n_surn', $this->iLike(), $field_value . '%'); |
||
| 828 | break; |
||
| 829 | case 'CONTAINS': |
||
| 830 | $query->where($table . '.n_surn', $this->iLike(), '%' . $field_value . '%'); |
||
| 831 | break; |
||
| 832 | case 'SDX_STD': |
||
| 833 | $sdx = Soundex::russell($field_value); |
||
| 834 | if ($sdx !== '') { |
||
| 835 | $this->wherePhonetic($query, $table . '.n_soundex_surn_std', $sdx); |
||
| 836 | } else { |
||
| 837 | // No phonetic content? Use a substring match |
||
| 838 | $query->where($table . '.n_surn', $this->iLike(), '%' . $field_value . '%'); |
||
| 839 | } |
||
| 840 | break; |
||
| 841 | case 'SDX': // SDX uses DM by default. |
||
| 842 | case 'SDX_DM': |
||
| 843 | $sdx = Soundex::daitchMokotoff($field_value); |
||
| 844 | if ($sdx !== '') { |
||
| 845 | $this->wherePhonetic($query, $table . '.n_soundex_surn_dm', $sdx); |
||
| 846 | } else { |
||
| 847 | // No phonetic content? Use a substring match |
||
| 848 | $query->where($table . '.n_surn', $this->iLike(), '%' . $field_value . '%'); |
||
| 849 | } |
||
| 850 | break; |
||
| 851 | } |
||
| 852 | break; |
||
| 853 | } |
||
| 854 | unset($fields[$field_name]); |
||
| 855 | } elseif (str_starts_with($field_name, 'FAM:')) { |
||
| 856 | // e.g. searches for occupation, religion, note, etc. |
||
| 857 | // Initial matching only. Need PHP to apply filter. |
||
| 858 | $query->where('spouse_families.f_gedcom', $this->iLike(), "%\n1 " . $parts[1] . ' %' . $field_value . '%'); |
||
| 859 | } elseif (str_starts_with($field_name, 'INDI:') && str_ends_with($field_name, ':TYPE')) { |
||
| 860 | // Initial matching only. Need PHP to apply filter. |
||
| 861 | $query->where('individuals.i_gedcom', $this->iLike(), "%\n1 " . $parts[1] . "%\n2 TYPE %" . $field_value . '%'); |
||
| 862 | } elseif (str_starts_with($field_name, 'INDI:')) { |
||
| 863 | // e.g. searches for occupation, religion, note, etc. |
||
| 864 | // Initial matching only. Need PHP to apply filter. |
||
| 865 | $query->where('individuals.i_gedcom', $this->iLike(), "%\n1 " . $parts[1] . '%' . $parts[2] . '%' . $field_value . '%'); |
||
| 866 | } |
||
| 867 | } |
||
| 868 | |||
| 869 | return $query |
||
| 870 | ->get() |
||
| 871 | ->each($this->rowLimiter()) |
||
| 872 | ->map($this->individualRowMapper()) |
||
| 873 | ->filter(GedcomRecord::accessFilter()) |
||
| 874 | ->filter(static function (Individual $individual) use ($fields): bool { |
||
| 875 | // Check for searches which were only partially matched by SQL |
||
| 876 | foreach ($fields as $field_name => $field_value) { |
||
| 877 | $parts = explode(':', $field_name . '::::'); |
||
| 878 | |||
| 879 | if (str_starts_with($field_name, 'INDI:NAME:') && $field_name !== 'INDI:NAME:GIVN' && $field_name !== 'INDI:NAME:SURN') { |
||
| 880 | $regex = '/\n1 NAME.*(?:\n2.*)*\n2 ' . $parts[2] . ' .*' . preg_quote($field_value, '/') . '/i'; |
||
| 881 | |||
| 882 | if (preg_match($regex, $individual->gedcom()) === 1) { |
||
| 883 | continue; |
||
| 884 | } |
||
| 885 | |||
| 886 | return false; |
||
| 887 | } |
||
| 888 | |||
| 889 | $regex = '/' . preg_quote($field_value, '/') . '/i'; |
||
| 890 | |||
| 891 | if (str_starts_with($field_name, 'INDI:') && str_ends_with($field_name, ':PLAC')) { |
||
| 892 | foreach ($individual->facts([$parts[1]]) as $fact) { |
||
| 893 | if (preg_match($regex, $fact->place()->gedcomName()) === 1) { |
||
| 894 | continue 2; |
||
| 895 | } |
||
| 896 | } |
||
| 897 | return false; |
||
| 898 | } |
||
| 899 | |||
| 900 | if (str_starts_with($field_name, 'FAM:') && str_ends_with($field_name, ':PLAC')) { |
||
| 901 | foreach ($individual->spouseFamilies() as $family) { |
||
| 902 | foreach ($family->facts([$parts[1]]) as $fact) { |
||
| 903 | if (preg_match($regex, $fact->place()->gedcomName()) === 1) { |
||
| 904 | continue 3; |
||
| 905 | } |
||
| 906 | } |
||
| 907 | } |
||
| 908 | return false; |
||
| 909 | } |
||
| 910 | |||
| 911 | if ($field_name === 'INDI:FACT:TYPE' || $field_name === 'INDI:EVEN:TYPE' || $field_name === 'INDI:CHAN:_WT_USER') { |
||
| 912 | foreach ($individual->facts([$parts[1]]) as $fact) { |
||
| 913 | if (preg_match($regex, $fact->attribute($parts[2])) === 1) { |
||
| 914 | continue 2; |
||
| 915 | } |
||
| 916 | } |
||
| 917 | |||
| 918 | return false; |
||
| 919 | } |
||
| 920 | |||
| 921 | if (str_starts_with($field_name, 'INDI:')) { |
||
| 922 | foreach ($individual->facts([$parts[1]]) as $fact) { |
||
| 923 | if (preg_match($regex, $fact->value()) === 1) { |
||
| 924 | continue 2; |
||
| 925 | } |
||
| 926 | } |
||
| 927 | |||
| 928 | return false; |
||
| 929 | } |
||
| 930 | |||
| 931 | if (str_starts_with($field_name, 'FAM:')) { |
||
| 932 | foreach ($individual->spouseFamilies() as $family) { |
||
| 933 | foreach ($family->facts([$parts[1]]) as $fact) { |
||
| 934 | if (preg_match($regex, $fact->value()) === 1) { |
||
| 935 | continue 3; |
||
| 936 | } |
||
| 937 | } |
||
| 938 | } |
||
| 939 | return false; |
||
| 940 | } |
||
| 941 | } |
||
| 942 | |||
| 943 | return true; |
||
| 944 | }); |
||
| 1335 |