Debian Codegraph @

classes/Database/ReportLogMapperInterface.php

raw symbols SCIP
1 <?php
2
3 /**
4 * dmarc-srg - A php parser, viewer and summary report generator for incoming DMARC reports.
5 * Copyright (C) 2022-2023 Aleksey Andreev (liuch)
6 *
7 * Available at:
8 * https://github.com/liuch/dmarc-srg
9 *
10 * This program is free software: you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the Free
12 * Software Foundation, either version 3 of the License.
13 *
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * more details.
18 *
19 * You should have received a copy of the GNU General Public License along with
20 * this program. If not, see <http://www.gnu.org/licenses/>.
21 *
22 * =========================
23 *
24 * This file contains the ReportLogMapperInterface
25 *
26 * @category API
27 * @package DmarcSrg
28 * @author Aleksey Andreev (liuch)
29 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3
30 */
31
32 namespace Liuch\DmarcSrg\Database;
33
34 interface ReportLogMapperInterface
35 {
36 /**
37 * Fetches data of report log item from the database by id
38 *
39 * @param array $data Log data
40 *
41 * @return void
42 */
43 public function fetch(array &$data): void;
44
45 /**
46 * Saves data of report log item to the database
47 *
48 * @return void
49 */
50 public function save(array &$data): void;
51
52 /**
53 * Returns a list of report log items with given criteria
54 *
55 * @param array $filter Key-value array:
56 * 'from_time' => DateTime
57 * 'till_time' => DateTime
58 * @param array $order Key-value array with order options:
59 * 'direction' => string, 'ascent' or 'descent'
60 * @param array $limit Key-value array:
61 * 'offset' => int
62 * 'count' => int
63 *
64 * @return array
65 */
66 public function list(array &$filter, array &$order, array &$limit): array;
67
68 /**
69 * Returns the number of report log items matching the specified filter and limits
70 *
71 * @param array $filter Key-value array with filtering parameters
72 * @param array $limit Key-value array with limits
73 *
74 * @return int
75 */
76 public function count(array &$filter, array &$limit): int;
77
78 /**
79 * Deletes report log items from the database
80 *
81 * @param array $filter Key-value array with filtering parameters
82 * @param array $order Key-value array with order options:
83 * 'direction' => string, 'ascent' or 'descent'
84 * @param array $limit Key-value array with limits
85 *
86 * @return void
87 */
88 public function delete(array &$filter, array &$order, array &$limit): void;
89 }