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