Completed
Pull Request — master (#54)
by Eric
36:04
created

Resource::setLabelPropertyPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 1
cts 1
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Lug package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Lug\Component\Resource\Model;
13
14
/**
15
 * @author GeLo <[email protected]>
16
 */
17
class Resource implements ResourceInterface
18
{
19
    /**
20
     * @var string
21
     */
22
    private $name;
23
24
    /**
25
     * @var string[]
26
     */
27
    private $interfaces;
28
29
    /**
30
     * @var string
31
     */
32
    private $model;
33
34
    /**
35
     * @var string
36
     */
37
    private $driver;
38
39
    /**
40
     * @var string
41
     */
42
    private $driverManager;
43
44
    /**
45
     * @var string
46
     */
47
    private $driverMappingPath;
48
49
    /**
50
     * @var string
51
     */
52
    private $driverMappingFormat;
53
54
    /**
55
     * @var string
56
     */
57
    private $repository;
58
59
    /**
60
     * @var string|null
61
     */
62
    private $factory;
63
64
    /**
65
     * @var string|null
66
     */
67
    private $form;
68
69
    /**
70
     * @var string|null
71
     */
72
    private $choiceForm;
73
74
    /**
75
     * @var string|null
76
     */
77
    private $domainManager;
78
79
    /**
80
     * @var string|null
81
     */
82
    private $controller;
83
84
    /**
85
     * @var string|null
86
     */
87
    private $idPropertyPath;
88
89
    /**
90
     * @var string|null
91
     */
92
    private $labelPropertyPath;
93
94
    /**
95
     * @var ResourceInterface|null
96
     */
97
    private $translation;
98
99
    /**
100
     * @param string          $name
101
     * @param string|string[] $interfaces
102
     * @param string          $model
103
     */
104
    public function __construct($name, $interfaces, $model)
105
{
106
        $this->name = $name;
107
        $this->interfaces = (array) $interfaces;
108
        $this->model = $model;
109
    }
110
111
    /**
112
     * {@inheritdoc}
113
     */
114
    public function getName()
115
    {
116
        return $this->name;
117 30
    }
118
119
    /**
120
     * {@inheritdoc}
121
     */
122
    public function getInterfaces()
123
    {
124
        return $this->interfaces;
125
    }
126
127
    /**
128
     * {@inheritdoc}
129
     */
130
    public function getModel()
131
    {
132
        return $this->model;
133
    }
134
135 30
    /**
136 30
     * {@inheritdoc}
137 30
     */
138
    public function setModel($model)
139 30
    {
140 30
        $this->model = $model;
141 30
    }
142 30
143 30
    /**
144 30
     * {@inheritdoc}
145 30
     */
146 30
    public function getDriver()
147 30
    {
148 30
        return $this->driver;
149 30
    }
150 30
151 30
    /**
152 30
     * {@inheritdoc}
153
     */
154
    public function setDriver($driver)
155
    {
156
        $this->driver = $driver;
157 13
    }
158
159 13
    /**
160
     * {@inheritdoc}
161
     */
162
    public function getDriverManager()
163
    {
164
        return $this->driverManager;
165 14
    }
166
167 14
    /**
168
     * {@inheritdoc}
169
     */
170
    public function setDriverManager($driverManager)
171
    {
172
        $this->driverManager = $driverManager;
173 30
    }
174
175 30
    /**
176 30
     * {@inheritdoc}
177
     */
178
    public function getDriverMappingPath()
179
    {
180
        return $this->driverMappingPath;
181 14
    }
182
183 14
    /**
184
     * {@inheritdoc}
185
     */
186
    public function setDriverMappingPath($driverMappingPath)
187
    {
188
        $this->driverMappingPath = $driverMappingPath;
189 30
    }
190
191 30
    /**
192 30
     * {@inheritdoc}
193
     */
194
    public function getDriverMappingFormat()
195
    {
196
        return $this->driverMappingFormat;
197 14
    }
198
199 14
    /**
200
     * {@inheritdoc}
201
     */
202
    public function setDriverMappingFormat($driverMappingFormat)
203
    {
204
        $this->driverMappingFormat = $driverMappingFormat;
205 30
    }
206
207 30
    /**
208 30
     * {@inheritdoc}
209
     */
210
    public function getRepository()
211
    {
212
        return $this->repository;
213 14
    }
214
215 14
    /**
216
     * {@inheritdoc}
217
     */
218
    public function setRepository($repository)
219
    {
220
        $this->repository = $repository;
221 30
    }
222
223 30
    /**
224 30
     * {@inheritdoc}
225
     */
226
    public function getFactory()
227
    {
228
        return $this->factory;
229 13
    }
230
231 13
    /**
232
     * {@inheritdoc}
233
     */
234
    public function setFactory($factory)
235
    {
236
        $this->factory = $factory;
237 14
    }
238
239 14
    /**
240
     * {@inheritdoc}
241
     */
242
    public function getForm()
243
    {
244
        return $this->form;
245 30
    }
246
247 30
    /**
248 30
     * {@inheritdoc}
249
     */
250
    public function setForm($form)
251
    {
252
        $this->form = $form;
253 14
    }
254
255 14
    /**
256
     * {@inheritdoc}
257
     */
258
    public function getChoiceForm()
259
    {
260
        return $this->choiceForm;
261 30
    }
262
263 30
    /**
264 30
     * {@inheritdoc}
265
     */
266
    public function setChoiceForm($choiceForm)
267
    {
268
        $this->choiceForm = $choiceForm;
269 14
    }
270
271 14
    /**
272
     * {@inheritdoc}
273
     */
274
    public function getDomainManager()
275
    {
276
        return $this->domainManager;
277 30
    }
278
279 30
    /**
280 30
     * {@inheritdoc}
281
     */
282
    public function setDomainManager($domainManager)
283
    {
284
        $this->domainManager = $domainManager;
285 14
    }
286
287 14
    /**
288
     * {@inheritdoc}
289
     */
290
    public function getController()
291
    {
292
        return $this->controller;
293 30
    }
294
295 30
    /**
296 30
     * {@inheritdoc}
297
     */
298
    public function setController($controller)
299
    {
300
        $this->controller = $controller;
301 14
    }
302
303 14
    /**
304
     * {@inheritdoc}
305
     */
306
    public function getIdPropertyPath()
307
    {
308
        return $this->idPropertyPath;
309 30
    }
310
311 30
    /**
312 30
     * {@inheritdoc}
313
     */
314
    public function setIdPropertyPath($idPropertyPath)
315
    {
316
        $this->idPropertyPath = $idPropertyPath;
317 14
    }
318
319 14
    /**
320
     * {@inheritdoc}
321
     */
322
    public function getLabelPropertyPath()
323
    {
324
        return $this->labelPropertyPath;
325 30
    }
326
327 30
    /**
328 30
     * {@inheritdoc}
329
     */
330
    public function setLabelPropertyPath($labelPropertyPath)
331
    {
332
        $this->labelPropertyPath = $labelPropertyPath;
333 14
    }
334
335 14
    /**
336
     * {@inheritdoc}
337
     */
338
    public function getTranslation()
339
    {
340
        return $this->translation;
341 30
    }
342
343 30
    /**
344 30
     * {@inheritdoc}
345
     */
346
    public function setTranslation(ResourceInterface $translation = null)
347
    {
348
        $this->translation = $translation;
349 14
    }
350
}
351