xref: /webtrees/app/Census/CensusColumnGivenNames.php (revision fcfa147e10aaa6c7ff580c29bd6e5b88666befc1)
140150762SGreg Roach<?php
23976b470SGreg Roach
340150762SGreg Roach/**
440150762SGreg Roach * webtrees: online genealogy
58fcd0d32SGreg Roach * Copyright (C) 2019 webtrees development team
640150762SGreg Roach * This program is free software: you can redistribute it and/or modify
740150762SGreg Roach * it under the terms of the GNU General Public License as published by
840150762SGreg Roach * the Free Software Foundation, either version 3 of the License, or
940150762SGreg Roach * (at your option) any later version.
1040150762SGreg Roach * This program is distributed in the hope that it will be useful,
1140150762SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
1240150762SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1340150762SGreg Roach * GNU General Public License for more details.
1440150762SGreg Roach * You should have received a copy of the GNU General Public License
1540150762SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
1640150762SGreg Roach */
17*fcfa147eSGreg Roach
18e7f56f2aSGreg Roachdeclare(strict_types=1);
1915d603e7SGreg Roach
2040150762SGreg Roachnamespace Fisharebest\Webtrees\Census;
2140150762SGreg Roach
2240150762SGreg Roachuse Fisharebest\Webtrees\Individual;
2340150762SGreg Roach
2440150762SGreg Roach/**
2540150762SGreg Roach * The individual's full name.
2640150762SGreg Roach */
27c1010edaSGreg Roachclass CensusColumnGivenNames extends AbstractCensusColumn implements CensusColumnInterface
28c1010edaSGreg Roach{
2940150762SGreg Roach    /**
3040150762SGreg Roach     * Generate the likely value of this census column, based on available information.
3140150762SGreg Roach     *
3240150762SGreg Roach     * @param Individual $individual
3315d603e7SGreg Roach     * @param Individual $head
3440150762SGreg Roach     *
3540150762SGreg Roach     * @return string
3640150762SGreg Roach     */
378f53f488SRico Sonntag    public function generate(Individual $individual, Individual $head): string
38c1010edaSGreg Roach    {
3940150762SGreg Roach        foreach ($individual->getAllNames() as $name) {
4040150762SGreg Roach            return $name['givn'];
4140150762SGreg Roach        }
4240150762SGreg Roach
4340150762SGreg Roach        return '';
4440150762SGreg Roach    }
4540150762SGreg Roach}
46