Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3/**
4 * This file is part of the MADIS - RGPD Management application.
5 *
6 * @copyright Copyright (c) 2018-2019 Soluris - Solutions Numériques Territoriales Innovantes
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22declare(strict_types=1);
23
24namespace App\Domain\Registry\Repository;
25
26use App\Application\DDD\Repository\RepositoryInterface;
27use App\Application\Doctrine\Repository\DataTablesRepository;
28use App\Domain\User\Model\Collectivity;
29
30interface Proof extends RepositoryInterface, DataTablesRepository
31{
32    /**
33     * Insert an object.
34     */
35    public function insert($object): void;
36
37    /**
38     * Update an object.
39     */
40    public function update($object): void;
41
42    /**
43     * Create an object.
44     */
45    public function create();
46
47    /**
48     * Remove an object.
49     */
50    public function remove($object): void;
51
52    /**
53     * Get all objects.
54     *
55     * @return mixed[]
56     */
57    public function findAll(bool $deleted = false): array;
58
59    /**
60     * Get an object by ID.
61     *
62     * @param string $id The ID to find
63     *
64     * @return mixed[]
65     */
66    public function findOneById(string $id);
67
68    /**
69     * Find all proofs by associated collectivity.
70     *
71     * @param Collectivity $collectivity The collectivity to search with
72     * @param bool         $deleted      Get deleted rows or not
73     * @param array        $order        Order results
74     *
75     * @return array The array of proofs given by the collectivity
76     */
77    public function findAllByCollectivity(Collectivity $collectivity, bool $deleted = false, array $order = []);
78
79    /**
80     * Find all proofs by criteria.
81     *
82     * @param array $criteria List of criteria
83     *
84     * @return array The array of proofs given by criteria
85     */
86    public function findBy(array $criteria = []);
87
88    /**
89     * Find all active proofs by associated collectivity.
90     *
91     * @param Collectivity $collectivity The collectivity to search with
92     * @param bool         $archived     Get all archived or not
93     * @param array        $order        Order results
94     *
95     * @return array The array of proofs given by the collectivity
96     */
97    public function findAllArchivedByCollectivity(Collectivity $collectivity, bool $archived = false, array $order = []);
98
99    /**
100     * Get the last proof by type and collectivity.
101     */
102    public function findOneOrNullByTypeAndCollectivity(string $type, Collectivity $collectivity): ?\App\Domain\Registry\Model\Proof;
103
104    /**
105     * Count all by collectivity.
106     */
107    public function countAllByCollectivity(Collectivity $collectivity);
108
109    /**
110     * Average of proof filed.
111     *
112     * @return string The average
113     */
114    public function averageProofFiled(array $collectivities = []);
115
116    /**
117     * Average balance sheet proof created during the last year.
118     *
119     * @return string The count of mesurements
120     */
121    public function averageBalanceSheetProof(array $collectivities = []);
122}