Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
46.67% covered (danger)
46.67%
7 / 15
53.85% covered (warning)
53.85%
7 / 13
CRAP
0.00% covered (danger)
0.00%
0 / 1
DuplicationFormDTO
46.67% covered (danger)
46.67%
7 / 15
53.85% covered (warning)
53.85%
7 / 13
38.64
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 getType
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setType
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSourceCollectivity
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setSourceCollectivity
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getData
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setData
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getTargetOption
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setTargetOption
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getTargetCollectivityTypes
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setTargetCollectivityTypes
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getTargetCollectivities
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setTargetCollectivities
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
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\Admin\DTO;
25
26use App\Domain\User\Model\Collectivity;
27
28/**
29 * Class DuplicationFormDTO.
30 */
31class DuplicationFormDTO
32{
33    /**
34     * FR: Type de données à dupliquer.
35     *
36     * @var string|null
37     */
38    private $type;
39
40    /**
41     * FR: Structure source, à utiliser comme base pour la duplication.
42     *
43     * @var Collectivity|null
44     */
45    private $sourceCollectivity;
46
47    /**
48     * FR: Liste des données à dupliquer.
49     *
50     * @var array
51     */
52    private $data;
53
54    /**
55     * @var string|null
56     */
57    private $targetOption;
58
59    /**
60     * FR: Types des structures cible, sur lesquelles dupliquer les données.
61     *
62     * @var array
63     */
64    private $targetCollectivityTypes;
65
66    /**
67     * FR: Liste des structures cible, sur lesquelles dupliquer les données.
68     *
69     * @var Collectivity[]
70     */
71    private $targetCollectivities;
72
73    /**
74     * DuplicationFormDTO constructor.
75     */
76    public function __construct()
77    {
78        $this->data                    = [];
79        $this->targetCollectivityTypes = [];
80        $this->targetCollectivities    = [];
81    }
82
83    public function getType(): ?string
84    {
85        return $this->type;
86    }
87
88    public function setType(?string $type): void
89    {
90        $this->type = $type;
91    }
92
93    public function getSourceCollectivity(): ?Collectivity
94    {
95        return $this->sourceCollectivity;
96    }
97
98    public function setSourceCollectivity(?Collectivity $sourceCollectivity): void
99    {
100        $this->sourceCollectivity = $sourceCollectivity;
101    }
102
103    public function getData(): array
104    {
105        return $this->data;
106    }
107
108    public function setData(array $data): void
109    {
110        $this->data = $data;
111    }
112
113    public function getTargetOption(): ?string
114    {
115        return $this->targetOption;
116    }
117
118    public function setTargetOption(?string $targetOption): void
119    {
120        $this->targetOption = $targetOption;
121    }
122
123    public function getTargetCollectivityTypes(): array
124    {
125        return $this->targetCollectivityTypes;
126    }
127
128    public function setTargetCollectivityTypes(array $targetCollectivityTypes): void
129    {
130        $this->targetCollectivityTypes = $targetCollectivityTypes;
131    }
132
133    /**
134     * @return Collectivity[]
135     */
136    public function getTargetCollectivities(): array
137    {
138        return $this->targetCollectivities;
139    }
140
141    /**
142     * @param Collectivity[] $targetCollectivities
143     */
144    public function setTargetCollectivities(array $targetCollectivities): void
145    {
146        $this->targetCollectivities = $targetCollectivities;
147    }
148}