xref: /webtrees/app/Census/CensusColumnSexMZ.php (revision c2a8c8bf7de8a39f75d5bc4f1074a75217deff5f)
1*c2a8c8bfSGreg Roach<?php
2*c2a8c8bfSGreg Roach/**
3*c2a8c8bfSGreg Roach * webtrees: online genealogy
4*c2a8c8bfSGreg Roach * Copyright (C) 2015 webtrees development team
5*c2a8c8bfSGreg Roach * This program is free software: you can redistribute it and/or modify
6*c2a8c8bfSGreg Roach * it under the terms of the GNU General Public License as published by
7*c2a8c8bfSGreg Roach * the Free Software Foundation, either version 3 of the License, or
8*c2a8c8bfSGreg Roach * (at your option) any later version.
9*c2a8c8bfSGreg Roach * This program is distributed in the hope that it will be useful,
10*c2a8c8bfSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
11*c2a8c8bfSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12*c2a8c8bfSGreg Roach * GNU General Public License for more details.
13*c2a8c8bfSGreg Roach * You should have received a copy of the GNU General Public License
14*c2a8c8bfSGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
15*c2a8c8bfSGreg Roach */
16*c2a8c8bfSGreg Roachnamespace Fisharebest\Webtrees\Census;
17*c2a8c8bfSGreg Roach
18*c2a8c8bfSGreg Roachuse Fisharebest\Webtrees\Individual;
19*c2a8c8bfSGreg Roach
20*c2a8c8bfSGreg Roach/**
21*c2a8c8bfSGreg Roach * The individual's sex.
22*c2a8c8bfSGreg Roach */
23*c2a8c8bfSGreg Roachclass CensusColumnSexMZ extends AbstractCensusColumn implements CensusColumnInterface {
24*c2a8c8bfSGreg Roach	/**
25*c2a8c8bfSGreg Roach	 * Generate the likely value of this census column, based on available information.
26*c2a8c8bfSGreg Roach	 *
27*c2a8c8bfSGreg Roach	 * @param Individual      $individual
28*c2a8c8bfSGreg Roach	 * @param Individual|null $head
29*c2a8c8bfSGreg Roach	 *
30*c2a8c8bfSGreg Roach	 * @return string
31*c2a8c8bfSGreg Roach	 */
32*c2a8c8bfSGreg Roach	public function generate(Individual $individual, Individual $head = null) {
33*c2a8c8bfSGreg Roach		switch ($individual->getSex()) {
34*c2a8c8bfSGreg Roach		case 'M':
35*c2a8c8bfSGreg Roach			return 'M';
36*c2a8c8bfSGreg Roach		case 'F':
37*c2a8c8bfSGreg Roach			return 'Ž';
38*c2a8c8bfSGreg Roach		default:
39*c2a8c8bfSGreg Roach			return '';
40*c2a8c8bfSGreg Roach		}
41*c2a8c8bfSGreg Roach	}
42*c2a8c8bfSGreg Roach}
43