1b08296eeSGreg Roach<?php 2*3976b470SGreg Roach 3b08296eeSGreg Roach/** 4b08296eeSGreg Roach * webtrees: online genealogy 5b08296eeSGreg Roach * Copyright (C) 2019 webtrees development team 6b08296eeSGreg Roach * This program is free software: you can redistribute it and/or modify 7b08296eeSGreg Roach * it under the terms of the GNU General Public License as published by 8b08296eeSGreg Roach * the Free Software Foundation, either version 3 of the License, or 9b08296eeSGreg Roach * (at your option) any later version. 10b08296eeSGreg Roach * This program is distributed in the hope that it will be useful, 11b08296eeSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 12b08296eeSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13b08296eeSGreg Roach * GNU General Public License for more details. 14b08296eeSGreg Roach * You should have received a copy of the GNU General Public License 15b08296eeSGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 16b08296eeSGreg Roach */ 17b08296eeSGreg Roachdeclare(strict_types=1); 18b08296eeSGreg Roach 19e5a6b4d4SGreg Roachnamespace Fisharebest\Webtrees\Contracts; 20b08296eeSGreg Roach 21b08296eeSGreg Roach/** 22e5a6b4d4SGreg Roach * Behaviour required of a user object. 23b08296eeSGreg Roach */ 24e5a6b4d4SGreg Roachinterface UserInterface 25b08296eeSGreg Roach{ 26b08296eeSGreg Roach /** 27e5a6b4d4SGreg Roach * The user‘s internal identifier 28b08296eeSGreg Roach * 29b08296eeSGreg Roach * @return int 30b08296eeSGreg Roach */ 31e5a6b4d4SGreg Roach public function id(): int; 32b08296eeSGreg Roach 33b08296eeSGreg Roach /** 34e5a6b4d4SGreg Roach * The users email address. 35b08296eeSGreg Roach * 36b08296eeSGreg Roach * @return string 37b08296eeSGreg Roach */ 38e5a6b4d4SGreg Roach public function email(): string; 39b08296eeSGreg Roach 40b08296eeSGreg Roach /** 41e5a6b4d4SGreg Roach * The user‘s real name. 42b08296eeSGreg Roach * 43b08296eeSGreg Roach * @return string 44b08296eeSGreg Roach */ 45e5a6b4d4SGreg Roach public function realName(): string; 46b08296eeSGreg Roach 47b08296eeSGreg Roach /** 48e5a6b4d4SGreg Roach * The user‘s login name. 49b08296eeSGreg Roach * 50b08296eeSGreg Roach * @return string 51b08296eeSGreg Roach */ 52e5a6b4d4SGreg Roach public function userName(): string; 53b08296eeSGreg Roach 54b08296eeSGreg Roach /** 55b08296eeSGreg Roach * @param string $setting_name 56b08296eeSGreg Roach * @param string $default 57b08296eeSGreg Roach * 58b08296eeSGreg Roach * @return string 59b08296eeSGreg Roach */ 60e5a6b4d4SGreg Roach public function getPreference(string $setting_name, string $default = ''): string; 61b08296eeSGreg Roach 62b08296eeSGreg Roach /** 63b08296eeSGreg Roach * @param string $setting_name 64b08296eeSGreg Roach * @param string $setting_value 65b08296eeSGreg Roach * 66e5a6b4d4SGreg Roach * @return UserInterface 67b08296eeSGreg Roach */ 68e5a6b4d4SGreg Roach public function setPreference(string $setting_name, string $setting_value): UserInterface; 69b08296eeSGreg Roach} 70