Passed
Push — master ( 26f0d1...865369 )
by Anthony
03:01
created

Module::setCreationDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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