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