Passed
Pull Request — master (#347)
by Mirko
09:07
created

GeocacheLog::setDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 6
rs 9.4285
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use DateTime;
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * CacheLogs
10
 *
11
 * @ORM\Table(name="cache_logs", uniqueConstraints={@ORM\UniqueConstraint(name="uuid", columns={"uuid"})}, indexes={@ORM\Index(name="owner_notified", columns={"owner_notified"}), @ORM\Index(name="last_modified", columns={"last_modified"}), @ORM\Index(name="type", columns={"type", "cache_id"}), @ORM\Index(name="date_created", columns={"date_created"}), @ORM\Index(name="user_id", columns={"user_id", "cache_id"}), @ORM\Index(name="cache_id", columns={"cache_id", "user_id"}), @ORM\Index(name="date", columns={"cache_id", "date", "date_created"}), @ORM\Index(name="order_date", columns={"cache_id", "order_date", "date_created", "id"})})
12
 * @ORM\Entity
13
 */
14
class GeocacheLog
15
{
16
    const LOG_TYPE_FOUND = 1;
17
    const LOG_TYPE_NOT_FOUND = 2;
18
    const LOG_TYPE_NOTE = 3;
19
    const LOG_TYPE_ATTENDED = 7;
20
21
    const NEEDS_MAINTENANCE_ACTIVATE = 2;
22
    const NEEDS_MAINTENANCE_DEACTIVATE = 1;
23
24
    /**
25
     * @var string
26
     *
27
     * @ORM\Column(name="uuid", type="string", length=36, nullable=false)
28
     */
29
    private $uuid;
30
31
    /**
32
     * @var int
33
     *
34
     * @ORM\Column(name="node", type="integer", nullable=false)
35
     */
36
    private $node = 0;
37
38
    /**
39
     * @var \DateTime
40
     *
41
     * @ORM\Column(name="date_created", type="datetime", nullable=false)
42
     */
43
    private $dateCreated;
44
45
    /**
46
     * @var \DateTime
47
     *
48
     * @ORM\Column(name="entry_last_modified", type="datetime", nullable=false)
49
     */
50
    private $entryLastModified;
51
52
    /**
53
     * @var \DateTime
54
     *
55
     * @ORM\Column(name="last_modified", type="datetime", nullable=false)
56
     */
57
    private $lastModified;
58
59
    /**
60
     * @var \DateTime
61
     *
62
     * @ORM\Column(name="log_last_modified", type="datetime", nullable=false)
63
     */
64
    private $logLastModified;
65
66
    /**
67
     * @var integer
68
     *
69
     * @ORM\Column(name="cache_id", type="integer", nullable=false)
70
     */
71
    private $cacheId;
72
73
    /**
74
     * @var \AppBundle\Entity\User $user
75
     *
76
     * @ORM\ManyToOne(targetEntity="\AppBundle\Entity\User")
77
     * @ORM\JoinColumn(name="user_id", referencedColumnName="user_id", onDelete="CASCADE")
78
     */
79
    private $user;
0 ignored issues
show
Unused Code introduced by
The property $user is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
80
81
    /**
82
     * @var boolean
83
     *
84
     * @ORM\Column(name="type", type="boolean", nullable=false)
85
     */
86
    private $type;
87
88
    /**
89
     * @var bool
90
     *
91
     * @ORM\Column(name="oc_team_comment", type="boolean", nullable=false)
92
     */
93
    private $ocTeamComment = false;
94
95
    /**
96
     * @var \DateTime
97
     *
98
     * @ORM\Column(name="date", type="datetime", nullable=false)
99
     */
100
    private $date;
101
102
    /**
103
     * @var \DateTime
104
     *
105
     * @ORM\Column(name="order_date", type="datetime", nullable=false)
106
     */
107
    private $orderDate;
108
109
    /**
110
     * @var int
111
     *
112
     * @ORM\Column(name="needs_maintenance", type="integer", nullable=false)
113
     */
114
    private $needsMaintenance = 0;
115
116
    /**
117
     * @var int
118
     *
119
     * @ORM\Column(name="listing_outdated", type="integer", nullable=false)
120
     */
121
    private $listingOutdated = 0;
122
123
    /**
124
     * @var string
125
     *
126
     * @ORM\Column(name="text", type="text", nullable=false)
127
     */
128
    private $text;
129
130
    /**
131
     * @var bool
132
     *
133
     * @ORM\Column(name="text_html", type="boolean", nullable=false)
134
     */
135
    private $textHtml = true;
136
137
    /**
138
     * @var bool
139
     *
140
     * @ORM\Column(name="text_htmledit", type="boolean", nullable=false)
141
     */
142
    private $textHtmledit = true;
143
144
    /**
145
     * @var bool
146
     *
147
     * @ORM\Column(name="owner_notified", type="boolean", nullable=false)
148
     */
149
    private $ownerNotified = false;
150
151
    /**
152
     * @var integer
153
     *
154
     * @ORM\Column(name="picture", type="smallint", nullable=false)
155
     */
156
    private $picture;
157
158
    /**
159
     * @var integer
160
     *
161
     * @ORM\Column(name="id", type="integer")
162
     * @ORM\Id
163
     * @ORM\GeneratedValue(strategy="IDENTITY")
164
     */
165
    private $id;
166
167
    /**
168
     * Set uuid
169
     *
170
     * @param string $uuid
171
     *
172
     * @return \AppBundle\Entity\GeocacheLog
173
     */
174
    public function setUuid($uuid)
175
    {
176
        $this->uuid = $uuid;
177
178
        return $this;
179
    }
180
181
    /**
182
     * Get uuid
183
     *
184
     * @return string
185
     */
186
    public function getUuid()
187
    {
188
        return $this->uuid;
189
    }
190
191
    /**
192
     * Set node
193
     *
194
     * @param bool $node
195
     *
196
     * @return \AppBundle\Entity\GeocacheLog
197
     */
198
    public function setNode($node)
199
    {
200
        $this->node = $node;
0 ignored issues
show
Documentation Bug introduced by
The property $node was declared of type integer, but $node is of type boolean. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
201
202
        return $this;
203
    }
204
205
    /**
206
     * Get node
207
     *
208
     * @return bool
209
     */
210
    public function getNode()
211
    {
212
        return $this->node;
213
    }
214
215
    /**
216
     * Set dateCreated
217
     *
218
     * @param \DateTime $dateCreated
219
     *
220
     * @return \AppBundle\Entity\GeocacheLog
221
     */
222
    public function setDateCreated(DateTime $dateCreated)
223
    {
224
        $this->dateCreated = $dateCreated;
225
226
        return $this;
227
    }
228
229
    /**
230
     * Get dateCreated
231
     *
232
     * @return \DateTime
233
     */
234
    public function getDateCreated()
235
    {
236
        return $this->dateCreated;
237
    }
238
239
    /**
240
     * Set entryLastModified
241
     *
242
     * @param \DateTime $entryLastModified
243
     *
244
     * @return \AppBundle\Entity\GeocacheLog
245
     */
246
    public function setEntryLastModified(DateTime $entryLastModified)
247
    {
248
        $this->entryLastModified = $entryLastModified;
249
250
        return $this;
251
    }
252
253
    /**
254
     * Get entryLastModified
255
     *
256
     * @return \DateTime
257
     */
258
    public function getEntryLastModified()
259
    {
260
        return $this->entryLastModified;
261
    }
262
263
    /**
264
     * Set lastModified
265
     *
266
     * @param \DateTime $lastModified
267
     *
268
     * @return \AppBundle\Entity\GeocacheLog
269
     */
270
    public function setLastModified(DateTime $lastModified)
271
    {
272
        $this->lastModified = $lastModified;
273
274
        return $this;
275
    }
276
277
    /**
278
     * Get lastModified
279
     *
280
     * @return \DateTime
281
     */
282
    public function getLastModified()
283
    {
284
        return $this->lastModified;
285
    }
286
287
    /**
288
     * Set logLastModified
289
     *
290
     * @param \DateTime $logLastModified
291
     *
292
     * @return \AppBundle\Entity\GeocacheLog
293
     */
294
    public function setLogLastModified(DateTime $logLastModified)
295
    {
296
        $this->logLastModified = $logLastModified;
297
298
        return $this;
299
    }
300
301
    /**
302
     * Get logLastModified
303
     *
304
     * @return \DateTime
305
     */
306
    public function getLogLastModified()
307
    {
308
        return $this->logLastModified;
309
    }
310
311
    /**
312
     * Set cacheId
313
     *
314
     * @param int $cacheId
315
     *
316
     * @return \AppBundle\Entity\GeocacheLog
317
     */
318
    public function setCacheId($cacheId)
319
    {
320
        $this->cacheId = $cacheId;
321
322
        return $this;
323
    }
324
325
    /**
326
     * Get cacheId
327
     *
328
     * @return int
329
     */
330
    public function getCacheId()
331
    {
332
        return $this->cacheId;
333
    }
334
335
    /**
336
     * Set type
337
     *
338
     * @param bool $type
339
     *
340
     * @return \AppBundle\Entity\GeocacheLog
341
     */
342
    public function setType($type)
343
    {
344
        $this->type = $type;
345
346
        return $this;
347
    }
348
349
    /**
350
     * Get type
351
     *
352
     * @return bool
353
     */
354
    public function getType()
355
    {
356
        return $this->type;
357
    }
358
359
    /**
360
     * Set ocTeamComment
361
     *
362
     * @param bool $ocTeamComment
363
     *
364
     * @return \AppBundle\Entity\GeocacheLog
365
     */
366
    public function setOcTeamComment($ocTeamComment)
367
    {
368
        $this->ocTeamComment = $ocTeamComment;
369
370
        return $this;
371
    }
372
373
    /**
374
     * Get ocTeamComment
375
     *
376
     * @return bool
377
     */
378
    public function getOcTeamComment()
379
    {
380
        return $this->ocTeamComment;
381
    }
382
383
    /**
384
     * Set date
385
     *
386
     * @param \DateTime $date
387
     *
388
     * @return \AppBundle\Entity\GeocacheLog
389
     */
390
    public function setDate(DateTime $date)
391
    {
392
        $this->date = $date;
393
394
        return $this;
395
    }
396
397
    /**
398
     * Get date
399
     *
400
     * @return \DateTime
401
     */
402
    public function getDate()
403
    {
404
        return $this->date;
405
    }
406
407
    /**
408
     * Set orderDate
409
     *
410
     * @param \DateTime $orderDate
411
     *
412
     * @return \AppBundle\Entity\GeocacheLog
413
     */
414
    public function setOrderDate(DateTime $orderDate)
415
    {
416
        $this->orderDate = $orderDate;
417
418
        return $this;
419
    }
420
421
    /**
422
     * Get orderDate
423
     *
424
     * @return \DateTime
425
     */
426
    public function getOrderDate()
427
    {
428
        return $this->orderDate;
429
    }
430
431
    /**
432
     * Set needsMaintenance
433
     *
434
     * @param bool $needsMaintenance
435
     *
436
     * @return \AppBundle\Entity\GeocacheLog
437
     */
438
    public function setNeedsMaintenance($needsMaintenance)
439
    {
440
        $this->needsMaintenance = $needsMaintenance;
0 ignored issues
show
Documentation Bug introduced by
The property $needsMaintenance was declared of type integer, but $needsMaintenance is of type boolean. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
441
442
        return $this;
443
    }
444
445
    /**
446
     * Get needsMaintenance
447
     *
448
     * @return bool
449
     */
450
    public function getNeedsMaintenance()
451
    {
452
        return $this->needsMaintenance;
453
    }
454
455
    /**
456
     * Set listingOutdated
457
     *
458
     * @param bool $listingOutdated
459
     *
460
     * @return \AppBundle\Entity\GeocacheLog
461
     */
462
    public function setListingOutdated($listingOutdated)
463
    {
464
        $this->listingOutdated = $listingOutdated;
0 ignored issues
show
Documentation Bug introduced by
The property $listingOutdated was declared of type integer, but $listingOutdated is of type boolean. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
465
466
        return $this;
467
    }
468
469
    /**
470
     * Get listingOutdated
471
     *
472
     * @return bool
473
     */
474
    public function getListingOutdated()
475
    {
476
        return $this->listingOutdated;
477
    }
478
479
    /**
480
     * Set text
481
     *
482
     * @param string $text
483
     *
484
     * @return \AppBundle\Entity\GeocacheLog
485
     */
486
    public function setText($text)
487
    {
488
        $this->text = $text;
489
490
        return $this;
491
    }
492
493
    /**
494
     * Get text
495
     *
496
     * @return string
497
     */
498
    public function getText()
499
    {
500
        return $this->text;
501
    }
502
503
    /**
504
     * Set textHtml
505
     *
506
     * @param bool $textHtml
507
     *
508
     * @return \AppBundle\Entity\GeocacheLog
509
     */
510
    public function setTextHtml($textHtml)
511
    {
512
        $this->textHtml = $textHtml;
513
514
        return $this;
515
    }
516
517
    /**
518
     * Get textHtml
519
     *
520
     * @return bool
521
     */
522
    public function getTextHtml()
523
    {
524
        return $this->textHtml;
525
    }
526
527
    /**
528
     * Set textHtmledit
529
     *
530
     * @param bool $textHtmledit
531
     *
532
     * @return \AppBundle\Entity\GeocacheLog
533
     */
534
    public function setTextHtmledit($textHtmledit)
535
    {
536
        $this->textHtmledit = $textHtmledit;
537
538
        return $this;
539
    }
540
541
    /**
542
     * Get textHtmledit
543
     *
544
     * @return bool
545
     */
546
    public function getTextHtmledit()
547
    {
548
        return $this->textHtmledit;
549
    }
550
551
    /**
552
     * Set ownerNotified
553
     *
554
     * @param bool $ownerNotified
555
     *
556
     * @return \AppBundle\Entity\GeocacheLog
557
     */
558
    public function setOwnerNotified($ownerNotified)
559
    {
560
        $this->ownerNotified = $ownerNotified;
561
562
        return $this;
563
    }
564
565
    /**
566
     * Get ownerNotified
567
     *
568
     * @return bool
569
     */
570
    public function getOwnerNotified()
571
    {
572
        return $this->ownerNotified;
573
    }
574
575
    /**
576
     * Set picture
577
     *
578
     * @param int $picture
579
     *
580
     * @return \AppBundle\Entity\GeocacheLog
581
     */
582
    public function setPicture($picture)
583
    {
584
        $this->picture = $picture;
585
586
        return $this;
587
    }
588
589
    /**
590
     * Get picture
591
     *
592
     * @return int
593
     */
594
    public function getPicture()
595
    {
596
        return $this->picture;
597
    }
598
599
    /**
600
     * Get id
601
     *
602
     * @return int
603
     */
604
    public function getId()
605
    {
606
        return $this->id;
607
    }
608
}
609