diff options
Diffstat (limited to 'app/Census/CensusColumnChildrenDied.php')
| -rw-r--r-- | app/Census/CensusColumnChildrenDied.php | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/app/Census/CensusColumnChildrenDied.php b/app/Census/CensusColumnChildrenDied.php index 2819d84576..2c749e24d6 100644 --- a/app/Census/CensusColumnChildrenDied.php +++ b/app/Census/CensusColumnChildrenDied.php @@ -22,35 +22,37 @@ use Fisharebest\Webtrees\Individual; /** * The number of children who have died. */ -class CensusColumnChildrenDied extends AbstractCensusColumn implements CensusColumnInterface { - /** - * Generate the likely value of this census column, based on available information. - * - * @param Individual $individual - * @param Individual $head - * - * @return string - */ - public function generate(Individual $individual, Individual $head = null) { - if ($individual->getSex() !== 'F') { - return ''; - } +class CensusColumnChildrenDied extends AbstractCensusColumn implements CensusColumnInterface +{ + /** + * Generate the likely value of this census column, based on available information. + * + * @param Individual $individual + * @param Individual $head + * + * @return string + */ + public function generate(Individual $individual, Individual $head = null) + { + if ($individual->getSex() !== 'F') { + return ''; + } - $count = 0; - foreach ($individual->getSpouseFamilies() as $family) { - foreach ($family->getChildren() as $child) { - if ( - $child->getBirthDate()->isOK() && - Date::compare($child->getBirthDate(), $this->date()) < 0 && - $child->getBirthDate() != $child->getDeathDate() && - $child->getDeathDate()->isOK() && - Date::compare($child->getDeathDate(), $this->date()) < 0 - ) { - $count++; - } - } - } + $count = 0; + foreach ($individual->getSpouseFamilies() as $family) { + foreach ($family->getChildren() as $child) { + if ( + $child->getBirthDate()->isOK() && + Date::compare($child->getBirthDate(), $this->date()) < 0 && + $child->getBirthDate() != $child->getDeathDate() && + $child->getDeathDate()->isOK() && + Date::compare($child->getDeathDate(), $this->date()) < 0 + ) { + $count++; + } + } + } - return (string) $count; - } + return (string)$count; + } } |
