diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2018-11-11 06:25:19 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2018-11-18 09:14:42 +0000 |
| commit | e7766c081c2e7ece562ab624d78f341efea2ba24 (patch) | |
| tree | 29c2467c263c265fcbf00d8a54abeba6d361fcc5 | |
| parent | 6b5586363e920c099d99ffacb831054d895e4ed3 (diff) | |
| download | webtrees-e7766c081c2e7ece562ab624d78f341efea2ba24.tar.gz webtrees-e7766c081c2e7ece562ab624d78f341efea2ba24.tar.bz2 webtrees-e7766c081c2e7ece562ab624d78f341efea2ba24.zip | |
Rename Fact::getParent() to record()
| -rw-r--r-- | app/Fact.php | 54 | ||||
| -rw-r--r-- | app/FactLocation.php | 2 | ||||
| -rw-r--r-- | app/Functions/FunctionsEdit.php | 2 | ||||
| -rw-r--r-- | app/Functions/FunctionsPrint.php | 4 | ||||
| -rw-r--r-- | app/Functions/FunctionsPrintFacts.php | 22 | ||||
| -rw-r--r-- | app/Http/Controllers/CalendarController.php | 6 | ||||
| -rw-r--r-- | app/Http/Controllers/IndividualController.php | 4 | ||||
| -rw-r--r-- | app/Module/YahrzeitModule.php | 2 | ||||
| -rw-r--r-- | app/Services/CalendarService.php | 4 | ||||
| -rw-r--r-- | resources/views/edit/raw-gedcom-fact.phtml | 6 | ||||
| -rw-r--r-- | resources/views/edit/reorder-names.phtml | 2 | ||||
| -rw-r--r-- | resources/views/modules/todays_events/list.phtml | 2 | ||||
| -rw-r--r-- | resources/views/modules/todays_events/table.phtml | 2 | ||||
| -rw-r--r-- | resources/views/modules/todo/research-tasks.phtml | 6 | ||||
| -rw-r--r-- | resources/views/modules/upcoming_events/list.phtml | 2 | ||||
| -rw-r--r-- | resources/views/modules/upcoming_events/table.phtml | 2 | ||||
| -rw-r--r-- | resources/views/timeline-chart.phtml | 14 |
17 files changed, 68 insertions, 68 deletions
diff --git a/app/Fact.php b/app/Fact.php index eb3258c096..2c4b346a71 100644 --- a/app/Fact.php +++ b/app/Fact.php @@ -135,7 +135,7 @@ class Fact private $fact_id; /** @var GedcomRecord The GEDCOM record from which this fact is taken */ - private $parent; + private $record; /** @var string The raw GEDCOM data for this fact */ private $gedcom; @@ -173,7 +173,7 @@ class Fact { if (preg_match('/^1 (' . WT_REGEX_TAG . ')/', $gedcom, $match)) { $this->gedcom = $gedcom; - $this->parent = $parent; + $this->record = $parent; $this->fact_id = $fact_id; $this->tag = $match[1]; } else { @@ -207,21 +207,21 @@ class Fact switch ($this->tag) { case 'FAMC': case 'FAMS': - return Family::getInstance($xref, $this->getParent()->getTree()); + return Family::getInstance($xref, $this->record()->getTree()); case 'HUSB': case 'WIFE': case 'CHIL': - return Individual::getInstance($xref, $this->getParent()->getTree()); + return Individual::getInstance($xref, $this->record()->getTree()); case 'SOUR': - return Source::getInstance($xref, $this->getParent()->getTree()); + return Source::getInstance($xref, $this->record()->getTree()); case 'OBJE': - return Media::getInstance($xref, $this->getParent()->getTree()); + return Media::getInstance($xref, $this->record()->getTree()); case 'REPO': - return Repository::getInstance($xref, $this->getParent()->getTree()); + return Repository::getInstance($xref, $this->record()->getTree()); case 'NOTE': - return Note::getInstance($xref, $this->getParent()->getTree()); + return Note::getInstance($xref, $this->record()->getTree()); default: - return GedcomRecord::getInstance($xref, $this->getParent()->getTree()); + return GedcomRecord::getInstance($xref, $this->record()->getTree()); } } @@ -251,7 +251,7 @@ class Fact public function canShow(int $access_level = null): bool { if ($access_level === null) { - $access_level = Auth::accessLevel($this->getParent()->getTree()); + $access_level = Auth::accessLevel($this->record()->getTree()); } // Does this record have an explicit RESN? @@ -266,9 +266,9 @@ class Fact } // Does this record have a default RESN? - $xref = $this->parent->getXref(); - $fact_privacy = $this->parent->getTree()->getFactPrivacy(); - $individual_fact_privacy = $this->parent->getTree()->getIndividualFactPrivacy(); + $xref = $this->record->getXref(); + $fact_privacy = $this->record->getTree()->getFactPrivacy(); + $individual_fact_privacy = $this->record->getTree()->getIndividualFactPrivacy(); if (isset($individual_fact_privacy[$xref][$this->tag])) { return $individual_fact_privacy[$xref][$this->tag] >= $access_level; } @@ -290,9 +290,9 @@ class Fact // Managers can edit anything // Members cannot edit RESN, CHAN and locked records return - $this->parent->canEdit() && !$this->isPendingDeletion() && ( - Auth::isManager($this->parent->getTree()) || - Auth::isEditor($this->parent->getTree()) && strpos($this->gedcom, "\n2 RESN locked") === false && $this->getTag() != 'RESN' && $this->getTag() != 'CHAN' + $this->record->canEdit() && !$this->isPendingDeletion() && ( + Auth::isManager($this->record->getTree()) || + Auth::isEditor($this->record->getTree()) && strpos($this->gedcom, "\n2 RESN locked") === false && $this->getTag() != 'RESN' && $this->getTag() != 'CHAN' ); } @@ -304,7 +304,7 @@ class Fact public function getPlace(): Place { if ($this->place === null) { - $this->place = new Place($this->getAttribute('PLAC'), $this->getParent()->getTree()); + $this->place = new Place($this->getAttribute('PLAC'), $this->record()->getTree()); } return $this->place; @@ -373,9 +373,9 @@ class Fact * * @return Individual|Family|Source|Repository|Media|Note|GedcomRecord */ - public function getParent() + public function record() { - return $this->parent; + return $this->record; } /** @@ -390,7 +390,7 @@ class Fact return I18N::translate(e($this->getAttribute('TYPE'))); } - return GedcomTag::getLabel($this->tag, $this->parent); + return GedcomTag::getLabel($this->tag, $this->record); } /** @@ -445,7 +445,7 @@ class Fact preg_match_all('/\n(2 SOUR @(' . WT_REGEX_XREF . ')@(?:\n[3-9] .*)*)/', $this->getGedcom(), $matches, PREG_SET_ORDER); $citations = []; foreach ($matches as $match) { - $source = Source::getInstance($match[2], $this->getParent()->getTree()); + $source = Source::getInstance($match[2], $this->record()->getTree()); if ($source && $source->canShow()) { $citations[] = $match[1]; } @@ -466,7 +466,7 @@ class Fact foreach ($matches[1] as $match) { $note = preg_replace("/\n3 CONT ?/", "\n", $match); if (preg_match('/@(' . WT_REGEX_XREF . ')@/', $note, $nmatch)) { - $note = Note::getInstance($nmatch[1], $this->getParent()->getTree()); + $note = Note::getInstance($nmatch[1], $this->record()->getTree()); if ($note && $note->canShow()) { // A note object $notes[] = $note; @@ -490,7 +490,7 @@ class Fact $media = []; preg_match_all('/\n2 OBJE @(' . WT_REGEX_XREF . ')@/', $this->getGedcom(), $matches); foreach ($matches[1] as $match) { - $obje = Media::getInstance($match, $this->getParent()->getTree()); + $obje = Media::getInstance($match, $this->record()->getTree()); if ($obje && $obje->canShow()) { $media[] = $obje; } @@ -519,8 +519,8 @@ class Fact // Fact date $date = $this->getDate(); if ($date->isOK()) { - if (in_array($this->getTag(), explode('|', WT_EVENTS_BIRT)) && $this->getParent() instanceof Individual && $this->getParent()->getTree()->getPreference('SHOW_PARENTS_AGE')) { - $attributes[] = $date->display() . FunctionsPrint::formatParentsAges($this->getParent(), $date); + if (in_array($this->getTag(), explode('|', WT_EVENTS_BIRT)) && $this->record() instanceof Individual && $this->record()->getTree()->getPreference('SHOW_PARENTS_AGE')) { + $attributes[] = $date->display() . FunctionsPrint::formatParentsAges($this->record(), $date); } else { $attributes[] = $date->display(); } @@ -595,7 +595,7 @@ class Fact // Facts from same families stay grouped together // Keep MARR and DIV from the same families from mixing with events from other FAMs // Use the original order in which the facts were added - if ($a->parent instanceof Family && $b->parent instanceof Family && $a->parent !== $b->parent) { + if ($a->record instanceof Family && $b->record instanceof Family && $a->record !== $b->record) { return $a->sortOrder - $b->sortOrder; } @@ -655,6 +655,6 @@ class Fact */ public function __toString() { - return $this->fact_id . '@' . $this->parent->getXref(); + return $this->fact_id . '@' . $this->record->getXref(); } } diff --git a/app/FactLocation.php b/app/FactLocation.php index 26a6091d43..10970e0ce0 100644 --- a/app/FactLocation.php +++ b/app/FactLocation.php @@ -61,7 +61,7 @@ class FactLocation extends Location public function shortSummary(string $datatype, int $sosa): array { $self = $this->individual->getXref(); - $parent = $this->fact->getParent(); + $parent = $this->fact->record(); $name = ''; $url = ''; $tag = $this->fact->getLabel(); diff --git a/app/Functions/FunctionsEdit.php b/app/Functions/FunctionsEdit.php index e7be2d658d..917bb7d796 100644 --- a/app/Functions/FunctionsEdit.php +++ b/app/Functions/FunctionsEdit.php @@ -968,7 +968,7 @@ class FunctionsEdit */ public static function createEditForm(Fact $fact) { - $record = $fact->getParent(); + $record = $fact->record(); $tree = $record->getTree(); self::$tags = []; diff --git a/app/Functions/FunctionsPrint.php b/app/Functions/FunctionsPrint.php index 5992970ae1..200b2232c9 100644 --- a/app/Functions/FunctionsPrint.php +++ b/app/Functions/FunctionsPrint.php @@ -310,7 +310,7 @@ class FunctionsPrint } else { $ageText = '(' . $age . ' ' . I18N::translate('after death') . ')'; // Family events which occur after death are probably errors - if ($event->getParent() instanceof Family) { + if ($event->record() instanceof Family) { $ageText .= '<i class="icon-warning"></i>'; } } @@ -375,7 +375,7 @@ class FunctionsPrint */ public static function formatFactPlace(Fact $event, $anchor = false, $sub_records = false, $lds = false): string { - $tree = $event->getParent()->getTree(); + $tree = $event->record()->getTree(); if ($anchor) { // Show the full place name, for facts/events tab diff --git a/app/Functions/FunctionsPrintFacts.php b/app/Functions/FunctionsPrintFacts.php index d82b1dae22..dd8175ecf3 100644 --- a/app/Functions/FunctionsPrintFacts.php +++ b/app/Functions/FunctionsPrintFacts.php @@ -64,7 +64,7 @@ class FunctionsPrintFacts // Keep a track of children and grandchildren, so we can display their birth order "#1", "#2", etc. static $children = [], $grandchildren = []; - $parent = $fact->getParent(); + $parent = $fact->record(); $tree = $parent->getTree(); // Some facts don't get printed here ... @@ -102,7 +102,7 @@ class FunctionsPrintFacts // Who is this fact about? Need it to translate fact label correctly if ($parent instanceof Family && $record instanceof Individual) { // Family event - $label_person = $fact->getParent()->getSpouse($record); + $label_person = $fact->record()->getSpouse($record); } else { // Individual event $label_person = $parent; @@ -180,14 +180,14 @@ class FunctionsPrintFacts switch ($fact->getTag()) { case '_BIRT_CHIL': - $children[$fact->getParent()->getXref()] = true; + $children[$fact->record()->getXref()] = true; /* I18N: Abbreviation for "number %s" */ $label .= '<br>' . I18N::translate('#%s', I18N::number(count($children))); break; case '_BIRT_GCHI': case '_BIRT_GCH1': case '_BIRT_GCH2': - $grandchildren[$fact->getParent()->getXref()] = true; + $grandchildren[$fact->record()->getXref()] = true; /* I18N: Abbreviation for "number %s" */ $label .= '<br>' . I18N::translate('#%s', I18N::number(count($grandchildren))); break; @@ -496,7 +496,7 @@ class FunctionsPrintFacts */ private static function formatAssociateRelationship(Fact $event): string { - $parent = $event->getParent(); + $parent = $event->record(); // To whom is this record an assocate? if ($parent instanceof Individual) { // On an individual page, we just show links to the person @@ -515,7 +515,7 @@ class FunctionsPrintFacts $html = ''; // For each ASSO record foreach (array_merge($amatches1, $amatches2) as $amatch) { - $person = Individual::getInstance($amatch[1], $event->getParent()->getTree()); + $person = Individual::getInstance($amatch[1], $event->record()->getTree()); if ($person && $person->canShowName()) { // Is there a "RELA" tag if (preg_match('/\n[23] RELA (.+)/', $amatch[2], $rmatch)) { @@ -548,7 +548,7 @@ class FunctionsPrintFacts // Use same markup as GedcomTag::getLabelValue() $asso = I18N::translate('<span class="label">%1$s:</span> <span class="field" dir="auto">%2$s</span>', $label, $value); - } elseif (!$person && Auth::isEditor($event->getParent()->getTree())) { + } elseif (!$person && Auth::isEditor($event->record()->getTree())) { $asso = GedcomTag::getLabelValue('ASSO', '<span class="error">' . $amatch[1] . '</span>'); } else { $asso = ''; @@ -730,8 +730,8 @@ class FunctionsPrintFacts public static function printMainSources(Fact $fact, $level) { $factrec = $fact->getGedcom(); - $parent = $fact->getParent(); - $tree = $fact->getParent()->getTree(); + $parent = $fact->record(); + $tree = $fact->record()->getTree(); $nlevel = $level + 1; if ($fact->isPendingAddition()) { @@ -980,7 +980,7 @@ class FunctionsPrintFacts public static function printMainNotes(Fact $fact, $level) { $factrec = $fact->getGedcom(); - $parent = $fact->getParent(); + $parent = $fact->record(); $tree = $parent->getTree(); if ($fact->isPendingAddition()) { @@ -1133,7 +1133,7 @@ class FunctionsPrintFacts public static function printMainMedia(Fact $fact, $level) { $factrec = $fact->getGedcom(); - $parent = $fact->getParent(); + $parent = $fact->record(); $tree = $parent->getTree(); if ($fact->isPendingAddition()) { diff --git a/app/Http/Controllers/CalendarController.php b/app/Http/Controllers/CalendarController.php index 6927ca5d87..331d0411ef 100644 --- a/app/Http/Controllers/CalendarController.php +++ b/app/Http/Controllers/CalendarController.php @@ -301,7 +301,7 @@ class CalendarController extends AbstractBaseController case 'year': case 'day': foreach ($found_facts as $fact) { - $record = $fact->getParent(); + $record = $fact->record(); $xref = $record->getXref(); if ($record instanceof Individual) { if (empty($indis[$xref])) { @@ -322,7 +322,7 @@ class CalendarController extends AbstractBaseController foreach ($found_facts as $d => $facts) { $cal_facts[$d] = []; foreach ($facts as $fact) { - $xref = $fact->getParent()->getXref(); + $xref = $fact->record()->getXref(); if (empty($cal_facts[$d][$xref])) { $cal_facts[$d][$xref] = $this->calendarFactText($fact, false); } else { @@ -483,7 +483,7 @@ class CalendarController extends AbstractBaseController $filtered = []; $hundred_years = WT_CLIENT_JD - 36525; foreach ($facts as $fact) { - $record = $fact->getParent(); + $record = $fact->record(); if ($filtersx) { // Filter on sex if ($record instanceof Individual && $filtersx !== $record->getSex()) { diff --git a/app/Http/Controllers/IndividualController.php b/app/Http/Controllers/IndividualController.php index eceb0d4358..fe4e270606 100644 --- a/app/Http/Controllers/IndividualController.php +++ b/app/Http/Controllers/IndividualController.php @@ -246,7 +246,7 @@ class IndividualController extends AbstractBaseController */ private function formatNameRecord(Tree $tree, $n, Fact $fact): string { - $individual = $fact->getParent(); + $individual = $fact->record(); // Create a dummy record, so we can extract the formatted NAME value from it. $dummy = new Individual( @@ -353,7 +353,7 @@ class IndividualController extends AbstractBaseController */ private function formatSexRecord(Fact $fact): string { - $individual = $fact->getParent(); + $individual = $fact->record(); switch ($fact->getValue()) { case 'M': diff --git a/app/Module/YahrzeitModule.php b/app/Module/YahrzeitModule.php index b96a74739c..dc26fd7b8d 100644 --- a/app/Module/YahrzeitModule.php +++ b/app/Module/YahrzeitModule.php @@ -125,7 +125,7 @@ class YahrzeitModule extends AbstractModule implements ModuleBlockInterface $yahrzeit_date = new Date($yahrzeit_date->format('%@ %A %O %E')); $yahrzeits[] = (object) [ - 'individual' => $fact->getParent(), + 'individual' => $fact->record(), 'fact_date' => $fact->getDate(), 'fact' => $fact, 'jd' => $jd, diff --git a/app/Services/CalendarService.php b/app/Services/CalendarService.php index 2021fcc9d0..71fbfa47cd 100644 --- a/app/Services/CalendarService.php +++ b/app/Services/CalendarService.php @@ -155,7 +155,7 @@ class CalendarService } foreach ($found_facts as $fact) { - $record = $fact->getParent(); + $record = $fact->record(); // only living people ? if ($only_living) { if ($record instanceof Individual && $record->isDead()) { @@ -183,7 +183,7 @@ class CalendarService break; case 'alpha': uasort($facts, function (Fact $x, Fact $y): int { - return GedcomRecord::compare($x->getParent(), $y->getParent()); + return GedcomRecord::compare($x->record(), $y->record()); }); break; } diff --git a/resources/views/edit/raw-gedcom-fact.phtml b/resources/views/edit/raw-gedcom-fact.phtml index e040dbbfd9..839a24e847 100644 --- a/resources/views/edit/raw-gedcom-fact.phtml +++ b/resources/views/edit/raw-gedcom-fact.phtml @@ -5,8 +5,8 @@ <form class="wt-page-content" method="post"> <?= csrf_field() ?> - <input type="hidden" name="ged" value="<?= e($fact->getParent()->getTree()->getName()) ?>"> - <input type="hidden" name="xref" value="<?= e($fact->getParent()->getXref()) ?>"> + <input type="hidden" name="ged" value="<?= e($fact->record()->getTree()->getName()) ?>"> + <input type="hidden" name="xref" value="<?= e($fact->record()->getXref()) ?>"> <input type="hidden" name="fact_id" value="<?= e($fact->getFactId()) ?>"> @@ -30,7 +30,7 @@ <?= FontAwesome::decorativeIcon('save') ?> <?= /* I18N: A button label. */ I18N::translate('save') ?> </button> - <a class="btn btn-secondary" href="<?= e($fact->getParent()->url()) ?>"> + <a class="btn btn-secondary" href="<?= e($fact->record()->url()) ?>"> <?= FontAwesome::decorativeIcon('cancel') ?> <?= /* I18N: A button label. */ I18N::translate('cancel') ?> </a> diff --git a/resources/views/edit/reorder-names.phtml b/resources/views/edit/reorder-names.phtml index ff41627c18..bdb3f35454 100644 --- a/resources/views/edit/reorder-names.phtml +++ b/resources/views/edit/reorder-names.phtml @@ -17,7 +17,7 @@ <?= $fact->getValue() ?> </h3> <div class="card-body"> - <?= GedcomTag::getLabelValue('TYPE', GedcomCodeName::getValue($fact->getAttribute('TYPE'), $fact->getParent())) ?> + <?= GedcomTag::getLabelValue('TYPE', GedcomCodeName::getValue($fact->getAttribute('TYPE'), $fact->record())) ?> </div> </div> <?php endforeach ?> diff --git a/resources/views/modules/todays_events/list.phtml b/resources/views/modules/todays_events/list.phtml index f5b89e5d39..bea8b88bec 100644 --- a/resources/views/modules/todays_events/list.phtml +++ b/resources/views/modules/todays_events/list.phtml @@ -2,7 +2,7 @@ <?php use Fisharebest\Webtrees\Individual; ?> <?php foreach ($facts as $fact) : ?> - <?php $record = $fact->getParent(); ?> + <?php $record = $fact->record(); ?> <a href="<?= e($record->url()) ?>" class="list_item name2"> <?= $record->getFullName() ?> </a> diff --git a/resources/views/modules/todays_events/table.phtml b/resources/views/modules/todays_events/table.phtml index 1447460601..05a7f789a6 100644 --- a/resources/views/modules/todays_events/table.phtml +++ b/resources/views/modules/todays_events/table.phtml @@ -22,7 +22,7 @@ </thead> <tbody> <?php foreach ($facts as $fact) : ?> - <?php $record = $fact->getParent(); ?> + <?php $record = $fact->record(); ?> <tr> <td data-sort="<?= e($record->getSortName()) ?>"> <a href="<?= e($record->url()) ?>"> diff --git a/resources/views/modules/todo/research-tasks.phtml b/resources/views/modules/todo/research-tasks.phtml index 8d433cd801..0bbc998c3e 100644 --- a/resources/views/modules/todo/research-tasks.phtml +++ b/resources/views/modules/todo/research-tasks.phtml @@ -24,9 +24,9 @@ <td data-sort="<?= $task->getDate()->julianDay() ?>" class="d-none d-md-table-cell wt-side-block-optional"> <?= $task->getDate()->display() ?> </td> - <td data-sort="<?= e($task->getParent()->getSortName()) ?>"> - <a href="<?= e($task->getParent()->url()) ?>"> - <?= $task->getParent()->getFullName() ?> + <td data-sort="<?= e($task->record()->getSortName()) ?>"> + <a href="<?= e($task->record()->url()) ?>"> + <?= $task->record()->getFullName() ?> </a> </td> <td class="d-none d-md-table-cell wt-side-block-optional"> diff --git a/resources/views/modules/upcoming_events/list.phtml b/resources/views/modules/upcoming_events/list.phtml index f5b89e5d39..bea8b88bec 100644 --- a/resources/views/modules/upcoming_events/list.phtml +++ b/resources/views/modules/upcoming_events/list.phtml @@ -2,7 +2,7 @@ <?php use Fisharebest\Webtrees\Individual; ?> <?php foreach ($facts as $fact) : ?> - <?php $record = $fact->getParent(); ?> + <?php $record = $fact->record(); ?> <a href="<?= e($record->url()) ?>" class="list_item name2"> <?= $record->getFullName() ?> </a> diff --git a/resources/views/modules/upcoming_events/table.phtml b/resources/views/modules/upcoming_events/table.phtml index 1447460601..05a7f789a6 100644 --- a/resources/views/modules/upcoming_events/table.phtml +++ b/resources/views/modules/upcoming_events/table.phtml @@ -22,7 +22,7 @@ </thead> <tbody> <?php foreach ($facts as $fact) : ?> - <?php $record = $fact->getParent(); ?> + <?php $record = $fact->record(); ?> <tr> <td data-sort="<?= e($record->getSortName()) ?>"> <a href="<?= e($record->url()) ?>"> diff --git a/resources/views/timeline-chart.phtml b/resources/views/timeline-chart.phtml index 4c4e18483a..830a7ce0db 100644 --- a/resources/views/timeline-chart.phtml +++ b/resources/views/timeline-chart.phtml @@ -314,22 +314,22 @@ echo 'right: 3px;">'; } - $col = array_search($event->getParent(), $individuals); + $col = array_search($event->record(), $individuals); if ($col === false) { // Marriage event - use the color of the husband - $col = array_search($event->getParent()->getHusband(), $individuals); + $col = array_search($event->record()->getHusband(), $individuals); } if ($col === false) { // Marriage event - use the color of the wife - $col = array_search($event->getParent()->getWife(), $individuals); + $col = array_search($event->record()->getWife(), $individuals); } $col = $col % 6; echo '</td><td class="person' . $col . '">'; if (count($individuals) > 6) { // We only have six colours, so show naes if more than this number - echo $event->getParent()->getFullName() . ' — '; + echo $event->record()->getFullName() . ' — '; } - $record = $event->getParent(); + $record = $event->record(); echo $event->getLabel(); echo ' — '; if ($record instanceof Individual) { @@ -359,8 +359,8 @@ echo ' — ' . $event->getPlace()->getShortName(); } // Print spouses names for family events - if ($event->getParent() instanceof Family) { - echo ' — <a href="', e($event->getParent()->url()), '">', $event->getParent()->getFullName(), '</a>'; + if ($event->record() instanceof Family) { + echo ' — <a href="', e($event->record()->url()), '">', $event->record()->getFullName(), '</a>'; } echo '</td></tr></table>'; echo '</div>'; |
