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