diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-09-26 21:59:14 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-09-26 21:59:14 +0100 |
| commit | 40150762995019e237299a92690fdc53f25e4ccf (patch) | |
| tree | 17c846ae64f14a5def3a4538ad3135a62c57aaa4 /app/Census/CensusColumnSurname.php | |
| parent | 289506e348104ebaf4aad14d2f3e735c97b86b73 (diff) | |
| download | webtrees-40150762995019e237299a92690fdc53f25e4ccf.tar.gz webtrees-40150762995019e237299a92690fdc53f25e4ccf.tar.bz2 webtrees-40150762995019e237299a92690fdc53f25e4ccf.zip | |
Census definitions
Diffstat (limited to 'app/Census/CensusColumnSurname.php')
| -rw-r--r-- | app/Census/CensusColumnSurname.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/app/Census/CensusColumnSurname.php b/app/Census/CensusColumnSurname.php new file mode 100644 index 0000000000..ddac9e1246 --- /dev/null +++ b/app/Census/CensusColumnSurname.php @@ -0,0 +1,38 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2015 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +use Fisharebest\Webtrees\Individual; + +/** + * The individual's full name. + */ +class CensusColumnSurname 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) { + foreach ($individual->getAllNames() as $name) { + return $name['surname']; + } + + return ''; + } +} |
