xref: /webtrees/app/Statistics/Repository/Interfaces/EventRepositoryInterface.php (revision 39ca88ba08cefcfcaf891abfcf748f9c808eb326)
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
20/**
21 * A repository providing methods for event related statistics.
22 */
23interface EventRepositoryInterface
24{
25    /**
26     * Count the number of events (with dates).
27     *
28     * @param string[] $events
29     *
30     * @return string
31     */
32    public function totalEvents(array $events = []): string;
33
34    /**
35     * Count the number of births events (BIRT, CHR, BAPM, ADOP).
36     *
37     * @return string
38     */
39    public function totalEventsBirth(): string;
40
41    /**
42     * Count the number of births (BIRT).
43     *
44     * @return string
45     */
46    public function totalBirths(): string;
47
48    /**
49     * Count the number of death events (DEAT, BURI, CREM).
50     *
51     * @return string
52     */
53    public function totalEventsDeath(): string;
54
55    /**
56     * Count the number of deaths (DEAT).
57     *
58     * @return string
59     */
60    public function totalDeaths(): string;
61
62    /**
63     * Count the number of marriage events (MARR, _NMR).
64     *
65     * @return string
66     */
67    public function totalEventsMarriage(): string;
68
69    /**
70     * Count the number of marriages (MARR).
71     *
72     * @return string
73     */
74    public function totalMarriages(): string;
75
76    /**
77     * Count the number of divorce events (DIV, ANUL, _SEPR).
78     *
79     * @return string
80     */
81    public function totalEventsDivorce(): string;
82
83    /**
84     * Count the number of divorces (DIV).
85     *
86     * @return string
87     */
88    public function totalDivorces(): string;
89
90    /**
91     * Count the number of other events (not birth, death, marriage or divorce related).
92     *
93     * @return string
94     */
95    public function totalEventsOther(): string;
96
97    /**
98     * Find the earliest event.
99     *
100     * @return string
101     */
102    public function firstEvent(): string;
103
104    /**
105     * Find the latest event.
106     *
107     * @return string
108     */
109    public function lastEvent(): string;
110
111    /**
112     * Find the year of the earliest event.
113     *
114     * @return string
115     */
116    public function firstEventYear(): string;
117
118    /**
119     * Find the year of the latest event.
120     *
121     * @return string
122     */
123    public function lastEventYear(): string;
124
125    /**
126     * Find the type of the earliest event.
127     *
128     * @return string
129     */
130    public function firstEventType(): string;
131
132    /**
133     * Find the type of the latest event.
134     *
135     * @return string
136     */
137    public function lastEventType(): string;
138
139    /**
140     * Find the name of the individual with the earliest event.
141     *
142     * @return string
143     */
144    public function firstEventName(): string;
145
146    /**
147     * Find the name of the individual with the latest event.
148     *
149     * @return string
150     */
151    public function lastEventName(): string;
152
153    /**
154     * Find the location of the earliest event.
155     *
156     * @return string
157     */
158    public function firstEventPlace(): string;
159
160    /**
161     * Find the location of the latest event.
162     *
163     * @return string
164     */
165    public function lastEventPlace(): string;
166}
167