xref: /webtrees/app/Census/CensusColumnBirthMonthDay.php (revision d11be7027e34e3121be11cc025421873364403f9)
153a83c54Sglarwill<?php
253a83c54Sglarwill
353a83c54Sglarwill/**
453a83c54Sglarwill * webtrees: online genealogy
5*d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
653a83c54Sglarwill * This program is free software: you can redistribute it and/or modify
753a83c54Sglarwill * it under the terms of the GNU General Public License as published by
853a83c54Sglarwill * the Free Software Foundation, either version 3 of the License, or
953a83c54Sglarwill * (at your option) any later version.
1053a83c54Sglarwill * This program is distributed in the hope that it will be useful,
1153a83c54Sglarwill * but WITHOUT ANY WARRANTY; without even the implied warranty of
1253a83c54Sglarwill * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1353a83c54Sglarwill * GNU General Public License for more details.
1453a83c54Sglarwill * You should have received a copy of the GNU General Public License
1553a83c54Sglarwill * along with this program. If not, see <https://www.gnu.org/licenses/>.
1653a83c54Sglarwill */
1753a83c54Sglarwill
1853a83c54Sglarwilldeclare(strict_types=1);
1953a83c54Sglarwill
2053a83c54Sglarwillnamespace Fisharebest\Webtrees\Census;
2153a83c54Sglarwill
2253a83c54Sglarwilluse Fisharebest\Webtrees\Individual;
2353a83c54Sglarwill
2453a83c54Sglarwill/**
2553a83c54Sglarwill * The individual's month and date of birth.
2653a83c54Sglarwill */
2753a83c54Sglarwillclass CensusColumnBirthMonthDay extends AbstractCensusColumn implements CensusColumnInterface
2853a83c54Sglarwill{
2953a83c54Sglarwill    /**
3053a83c54Sglarwill     * Generate the likely value of this census column, based on available information.
3153a83c54Sglarwill     *
3253a83c54Sglarwill     * @param Individual $individual
3353a83c54Sglarwill     * @param Individual $head
3453a83c54Sglarwill     *
3553a83c54Sglarwill     * @return string
3653a83c54Sglarwill     */
3753a83c54Sglarwill    public function generate(Individual $individual, Individual $head): string
3853a83c54Sglarwill    {
3953a83c54Sglarwill        return $individual->getEstimatedBirthDate()->minimumDate()->format('%M %j');
4053a83c54Sglarwill    }
4153a83c54Sglarwill}
42