Passed
Push — master ( bf11d1...f2923d )
by Anthony
03:06
created

Module::setDevMode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace PiouPiou\RibsAdminBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Gedmo\Mapping\Annotation as Gedmo;
7
8
/**
9
 * Module
10
 *
11
 * @ORM\Table(name="module")
12
 * @ORM\Entity
13
 */
14
class Module
15
{
16
    /**
17
     * @var integer
18
     *
19
     * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true})
20
     * @ORM\Id
21
     * @ORM\GeneratedValue(strategy="IDENTITY")
22
     */
23
    private $id;
24
25
    /**
26
     * @var string
27
     *
28
     * @ORM\Column(name="package_name", type="string", length=255, nullable=false)
29
     */
30
    private $packageName;
31
32
    /**
33
     * @var string
34
     *
35
     * @ORM\Column(name="title_tag", type="string", length=70, nullable=true)
36
     */
37
    private $titleTag;
38
39
    /**
40
     * @var string
41
     *
42
     * @ORM\Column(name="description_tag", type="string", length=160, nullable=true)
43
     */
44
    private $descriptionTag;
45
46
    /**
47
     * @var string
48
     *
49
     * @ORM\Column(name="title", type="string", length=255, nullable=false)
50
     */
51
    private $title;
52
53
    /**
54
     * @var string
55
     *
56
     * @ORM\Column(name="template", type="string", length=255, nullable=true)
57
     */
58
    private $template;
59
60
    /**
61
     * @var string
62
     *
63
     * @ORM\Column(name="url", type="string", length=255, nullable=true)
64
     */
65
    private $url;
66
67
    /**
68
     * @var string
69
     *
70
     * @ORM\Column(name="url_admin", type="string", length=255, nullable=true)
71
     */
72
    private $urlAdmin;
73
74
    /**
75
     * @var boolean
76
     *
77
     * @ORM\Column(name="active", type="boolean", nullable=false)
78
     */
79
    private $active;
80
81
    /**
82
     * @var integer
83
     *
84
     * @ORM\Column(name="`order`", type="integer", nullable=true)
85
     */
86
    private $order;
87
88
    /**
89
     * @var boolean
90
     *
91
     * @ORM\Column(name="displayed", type="boolean", nullable=false)
92
     */
93
    private $displayed;
94
95
    /**
96
     * @var boolean
97
     *
98
     * @ORM\Column(name="dev_mode", type="boolean", nullable=false)
99
     */
100
    private $devMode;
101
102
    /**
103
     * @var \DateTime
104
     *
105
     * @Gedmo\Timestampable(on="create")
106
     * @ORM\Column(name="creation_date", type="date", nullable=true)
107
     */
108
    private $creationDate;
109
110
    /**
111
     * @var \DateTime
112
     *
113
     * @Gedmo\Timestampable(on="update")
114
     * @ORM\Column(name="update_date", type="date", nullable=true)
115
     */
116
    private $updateDate;
117
118
    /**
119
     * @return int
120
     */
121
    public function getId(): int
122
    {
123
        return $this->id;
124
    }
125
126
    /**
127
     * @param int $id
128
     */
129
    public function setId(int $id)
130
    {
131
        $this->id = $id;
132
    }
133
134
    /**
135
     * @return string
136
     */
137
    public function getPackageName(): ?string
138
    {
139
        return $this->packageName;
140
    }
141
142
    /**
143
     * @param string $package_name
144
     */
145
    public function setPackageName(string $package_name)
146
    {
147
        $this->packageName = $package_name;
148
    }
149
150
    /**
151
     * @return string
152
     */
153
    public function getTitleTag(): ?string
154
    {
155
        return $this->titleTag;
156
    }
157
158
    /**
159
     * @param string $titleTag
160
     */
161
    public function setTitleTag(string $titleTag)
162
    {
163
        $this->titleTag = $titleTag;
164
    }
165
166
    /**
167
     * @return string
168
     */
169
    public function getDescriptionTag(): ?string
170
    {
171
        return $this->descriptionTag;
172
    }
173
174
    /**
175
     * @param string $descriptionTag
176
     */
177
    public function setDescriptionTag(string $descriptionTag)
178
    {
179
        $this->descriptionTag = $descriptionTag;
180
    }
181
182
    /**
183
     * @return string
184
     */
185
    public function getTitle(): ?string
186
    {
187
        return $this->title;
188
    }
189
190
    /**
191
     * @param string $title
192
     */
193
    public function setTitle(string $title)
194
    {
195
        $this->title = $title;
196
    }
197
198
    /**
199
     * @return string
200
     */
201
    public function getTemplate(): ?string
202
    {
203
        return $this->template;
204
    }
205
206
    /**
207
     * @param string $template
208
     */
209
    public function setTemplate(string $template)
210
    {
211
        $this->template = $template;
212
    }
213
214
    /**
215
     * @return string
216
     */
217
    public function getUrl(): ?string
218
    {
219
        return $this->url;
220
    }
221
222
    /**
223
     * @param string $url
224
     */
225
    public function setUrl(string $url)
226
    {
227
        $this->url = $url;
228
    }
229
230
    /**
231
     * @return string
232
     */
233
    public function getUrlAdmin(): ?string
234
    {
235
        return $this->urlAdmin;
236
    }
237
238
    /**
239
     * @param string $urlAdmin
240
     */
241
    public function setUrlAdmin(string $urlAdmin)
242
    {
243
        $this->urlAdmin = $urlAdmin;
244
    }
245
246
    /**
247
     * @return boolean
248
     */
249
    public function getActive(): ?bool
250
    {
251
        return $this->active;
252
    }
253
254
    /**
255
     * @param bool $active
256
     */
257
    public function setActive(bool $active)
258
    {
259
        $this->active = $active;
260
    }
261
262
    /**
263
     * @return int
264
     */
265
    public function getOrder(): ?int
266
    {
267
        return $this->order;
268
    }
269
270
    /**
271
     * @param int $order
272
     */
273
    public function setOrder(int $order)
274
    {
275
        $this->order = $order;
276
    }
277
278
    /**
279
     * @return bool
280
     */
281
    public function getDisplayed(): ?bool
282
    {
283
        return $this->displayed;
284
    }
285
286
    /**
287
     * @param bool $displayed
288
     */
289
    public function setDisplayed(bool $displayed)
290
    {
291
        $this->displayed = $displayed;
292
    }
293
294
    /**
295
     * @return bool
296
     */
297
    public function getDevMode(): bool
298
    {
299
        return $this->devMode;
300
    }
301
302
    /**
303
     * @param bool $devMode
304
     * @return Module
305
     */
306
    public function setDevMode(bool $devMode): Module
307
    {
308
        $this->devMode = $devMode;
309
310
        return $this;
311
    }
312
313
    /**
314
     * @return \DateTime
315
     */
316
    public function getCreationDate(): \DateTime
317
    {
318
        return $this->creationDate;
319
    }
320
321
    /**
322
     * @param \DateTime $creationDate
323
     */
324
    public function setCreationDate(\DateTime $creationDate)
325
    {
326
        $this->creationDate = $creationDate;
327
    }
328
329
    /**
330
     * @return \DateTime
331
     */
332
    public function getUpdateDate(): \DateTime
333
    {
334
        return $this->updateDate;
335
    }
336
337
    /**
338
     * @param \DateTime $updateDate
339
     */
340
    public function setUpdateDate(\DateTime $updateDate)
341
    {
342
        $this->updateDate = $updateDate;
343
    }
344
345
    public function getFormattedActive()
346
    {
347
        return $this->getActive() ? "Oui" : "Non";
348
    }
349
350
    public function getFormattedDisplayed()
351
    {
352
        return $this->getDisplayed() ? "Oui" : "Non";
353
    }
354
}
355