summaryrefslogtreecommitdiff
path: root/library/WT/Family.php
diff options
context:
space:
mode:
Diffstat (limited to 'library/WT/Family.php')
-rw-r--r--library/WT/Family.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/library/WT/Family.php b/library/WT/Family.php
index 356c1f3ec8..5e1b531f99 100644
--- a/library/WT/Family.php
+++ b/library/WT/Family.php
@@ -158,16 +158,13 @@ class WT_Family extends WT_GedcomRecord {
return WT_Date::Compare($x->getMarriageDate(), $y->getMarriageDate());
}
- /**
- * get the number of children in this family
- * @return int the number of children
- */
+ // Number of children - for the individual list
function getNumberOfChildren() {
-
- $nchi1=(int)get_gedcom_value('NCHI', 1, $this->getGedcom());
- $nchi2=(int)get_gedcom_value('NCHI', 2, $this->getGedcom());
- $nchi3=count($this->getChildren());
- return max($nchi1, $nchi2, $nchi3);
+ $nchi = count($this->getChildren());
+ foreach ($this->getFacts('NCHI') as $fact) {
+ $nchi = max($nchi, (int)$fact->getValue());
+ }
+ return $nchi;
}
/**