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