xref: /webtrees/app/SurnameTradition/SurnameTraditionInterface.php (revision 3fa66c660869af2f4c92ef37e06997aa8a0f55e1)
1<?php
2/**
3 * webtrees: online genealogy
4 * Copyright (C) 2019 webtrees development team
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16declare(strict_types=1);
17
18namespace Fisharebest\Webtrees\SurnameTradition;
19
20/**
21 * Various cultures have different traditions for the use of surnames within families.
22 * By providing defaults for new individuals, we can speed up data entry and reduce errors.
23 */
24interface SurnameTraditionInterface
25{
26    /**
27     * Does this surname tradition change surname at marriage?
28     *
29     * @return bool
30     */
31    public function hasMarriedNames(): bool;
32
33    /**
34     * Does this surname tradition use surnames?
35     *
36     * @return bool
37     */
38    public function hasSurnames(): bool;
39
40    /**
41     * What names are given to a new child
42     *
43     * @param string $father_name A GEDCOM NAME
44     * @param string $mother_name A GEDCOM NAME
45     * @param string $child_sex   M, F or U
46     *
47     * @return string[] Associative array of GEDCOM name parts (SURN, _MARNM, etc.)
48     */
49    public function newChildNames(string $father_name, string $mother_name, string $child_sex): array;
50
51    /**
52     * What names are given to a new parent
53     *
54     * @param string $child_name A GEDCOM NAME
55     * @param string $parent_sex M, F or U
56     *
57     * @return string[] Associative array of GEDCOM name parts (SURN, _MARNM, etc.)
58     */
59    public function newParentNames(string $child_name, string $parent_sex): array;
60
61    /**
62     * What names are given to a new spouse
63     *
64     * @param string $spouse_name A GEDCOM NAME
65     * @param string $spouse_sex  M, F or U
66     *
67     * @return string[] Associative array of GEDCOM name parts (SURN, _MARNM, etc.)
68     */
69    public function newSpouseNames(string $spouse_name, string $spouse_sex): array;
70}
71