. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Census; use Fisharebest\Webtrees\Individual; /** * The individual's sex. */ class CensusColumnSexMF extends AbstractCensusColumn implements CensusColumnInterface { protected const MALE = 'M'; protected const FEMALE = 'F'; /** * 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): string { switch ($individual->sex()) { case 'M': return static::MALE; case 'F': return static::FEMALE; default: return ''; } } }