xref: /webtrees/app/Elements/NameType.php (revision d4af76c46d5b7651af8765f59805c6521f3242a4)
1<?php
2
3/**
4 * webtrees: online genealogy
5 * Copyright (C) 2022 webtrees development team
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18declare(strict_types=1);
19
20namespace Fisharebest\Webtrees\Elements;
21
22use Fisharebest\Webtrees\I18N;
23
24/**
25 * NAME_TYPE := {Size=5:30}
26 * [ aka | birth | immigrant | maiden | married | <user defined>]
27 * Indicates the name type, for example the name issued or assumed as an immigrant.
28 * aka          = also known as, alias, etc.
29 * birth        = name given on birth certificate.
30 * immigrant    = name assumed at the time of immigration.
31 * maiden       = maiden name, name before first marriage.
32 * married      =name was persons previous married name.
33 * user_defined = other text name that defines the name type.
34 */
35class NameType extends AbstractElement
36{
37    public const TYPE_ADOPTED   = 'adopted';
38    public const TYPE_AKA       = 'aka';
39    public const TYPE_BIRTH     = 'birth';
40    public const TYPE_CHANGE    = 'change';
41    public const TYPE_ESTATE    = 'estate';
42    public const TYPE_IMMIGRANT = 'immigrant';
43    public const TYPE_MAIDEN    = 'maiden';
44    public const TYPE_MARRIED   = 'married';
45    public const TYPE_RELIGIOUS = 'religious';
46
47    /**
48     * A list of controlled values for this element
49     *
50     * @return array<int|string,string>
51     */
52    public function values(): array
53    {
54        return [
55            ''                   => '',
56            /* I18N: The name given to a child by its adoptive parents */
57            self::TYPE_ADOPTED   => I18N::translate('adopted name'),
58            /* I18N: The name by which an individual is also known. e.g. a professional name or a stage name */
59            self::TYPE_AKA       => I18N::translate('also known as'),
60            /* I18N: The name given to an individual at their birth */
61            self::TYPE_BIRTH     => I18N::translate('birth name'),
62            /* I18N: A name chosen by an individual, to replace their existing name (whether legal or otherwise) */
63            self::TYPE_CHANGE    => I18N::translate('change of name'),
64            /* I18N: A name given to an individual, from the farm or estate on which they lived or worked */
65            self::TYPE_ESTATE    => I18N::translate('estate name'),
66            /* I18N: A name taken on immigration - e.g. migrants to the USA frequently anglicized their names */
67            self::TYPE_IMMIGRANT => I18N::translate('immigration name'),
68            /* I18N: A woman’s name, before she marries (in cultures where women take their new husband’s name on marriage) */
69            self::TYPE_MAIDEN    => I18N::translate('maiden name'),
70            /* I18N: A name taken on marriage - usually the wife takes the husband’s surname */
71            self::TYPE_MARRIED   => I18N::translate('married name'),
72            /* I18N: A name taken when entering a religion or a religious order */
73            self::TYPE_RELIGIOUS => I18N::translate('religious name'),
74        ];
75    }
76}
77