. */ namespace Fisharebest\Webtrees\Census; use Fisharebest\Webtrees\Individual; /** * Marital status. */ class CensusColumnConditionEnglish extends AbstractCensusColumn implements CensusColumnInterface { /** * Generate the likely value of this census column, based on available information. * * @param Individual $individual * @param Individual|null $head * * @return string */ public function generate(Individual $individual, Individual $head = null) { $family = $this->spouseFamily($individual); if ($family === null || count($family->getFacts('_NMR')) > 0) { return 'Unm'; // unmarried } elseif (count($family->getFacts('DIV')) > 0) { return 'Div'; // divorced } else { return 'Mar'; // married } } }