xref: /webtrees/app/Statistics/Repository/Interfaces/PlaceRepositoryInterface.php (revision 6dee9a8c9b87a4759535afc29fe1e81073a98265)
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\Statistics\Repository\Interfaces;
19
20use stdClass;
21
22/**
23 * A repository providing methods for place related statistics.
24 */
25interface PlaceRepositoryInterface
26{
27    /**
28     * Places
29     *
30     * @param string $what
31     * @param string $fact
32     * @param int    $parent
33     * @param bool   $country
34     *
35     * @return int[]|stdClass[]
36     */
37    public function statsPlaces(string $what = 'ALL', string $fact = '', int $parent = 0, bool $country = false): array;
38
39    /**
40     * A list of common birth places.
41     *
42     * @return string
43     */
44    public function commonBirthPlacesList(): string;
45
46    /**
47     * A list of common death places.
48     *
49     * @return string
50     */
51    public function commonDeathPlacesList(): string;
52
53    /**
54     * A list of common marriage places.
55     *
56     * @return string
57     */
58    public function commonMarriagePlacesList(): string;
59
60    /**
61     * A list of common countries.
62     *
63     * @return string
64     */
65    public function commonCountriesList(): string;
66
67    /**
68     * Count total places.
69     *
70     * @return string
71     */
72    public function totalPlaces(): string;
73
74    /**
75     * Create a chart showing where events occurred.
76     *
77     * @param string $chart_shows
78     * @param string $chart_type
79     * @param string $surname
80     *
81     * @return string
82     */
83    public function chartDistribution(
84        string $chart_shows = 'world',
85        string $chart_type = '',
86        string $surname = ''
87    ) : string;
88}
89