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