xref: /webtrees/app/SurnameTradition/SurnameTraditionInterface.php (revision f7ab47b1fce1949e7b44a4f7d92d527a70deb743)
1<?php
2
3/**
4 * webtrees: online genealogy
5 * Copyright (C) 2019 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 <http://www.gnu.org/licenses/>.
16 */
17
18declare(strict_types=1);
19
20namespace Fisharebest\Webtrees\SurnameTradition;
21
22/**
23 * Various cultures have different traditions for the use of surnames within families.
24 * By providing defaults for new individuals, we can speed up data entry and reduce errors.
25 */
26interface SurnameTraditionInterface
27{
28    /**
29     * Does this surname tradition change surname at marriage?
30     *
31     * @return bool
32     */
33    public function hasMarriedNames(): bool;
34
35    /**
36     * Does this surname tradition use surnames?
37     *
38     * @return bool
39     */
40    public function hasSurnames(): bool;
41
42    /**
43     * What names are given to a new child
44     *
45     * @param string $father_name A GEDCOM NAME
46     * @param string $mother_name A GEDCOM NAME
47     * @param string $child_sex   M, F or U
48     *
49     * @return string[] Associative array of GEDCOM name parts (SURN, _MARNM, etc.)
50     */
51    public function newChildNames(string $father_name, string $mother_name, string $child_sex): array;
52
53    /**
54     * What names are given to a new parent
55     *
56     * @param string $child_name A GEDCOM NAME
57     * @param string $parent_sex M, F or U
58     *
59     * @return string[] Associative array of GEDCOM name parts (SURN, _MARNM, etc.)
60     */
61    public function newParentNames(string $child_name, string $parent_sex): array;
62
63    /**
64     * What names are given to a new spouse
65     *
66     * @param string $spouse_name A GEDCOM NAME
67     * @param string $spouse_sex  M, F or U
68     *
69     * @return string[] Associative array of GEDCOM name parts (SURN, _MARNM, etc.)
70     */
71    public function newSpouseNames(string $spouse_name, string $spouse_sex): array;
72}
73