MemberEntity   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 517
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 9
c 3
b 0
f 0
lcom 1
cbo 0
dl 0
loc 517
ccs 0
cts 44
cp 0
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A setId() 0 6 1
A setNickname() 0 6 1
A getNickname() 0 4 1
A setRealName() 0 6 1
A setRegDate() 0 6 1
A setPassword() 0 7 1
A setEmailAddress() 0 6 1
A setAvatarUrl() 0 6 1
1
<?php
2
3
namespace Comrade42\PhpBBParser\Entity\SimpleMachines;
4
5
use Comrade42\PhpBBParser\Entity\MemberInterface;
6
7
/**
8
 * Class MemberEntity
9
 * @package Comrade42\PhpBBParser\Entity\SimpleMachines
10
 * @Entity
11
 * @Table(name="members", indexes={
12
 *     @Index(name="member_name", columns={"member_name"}),
13
 *     @Index(name="real_name", columns={"real_name"}),
14
 *     @Index(name="date_registered", columns={"date_registered"}),
15
 *     @Index(name="id_group", columns={"id_group"}),
16
 *     @Index(name="birthdate", columns={"birthdate"}),
17
 *     @Index(name="posts", columns={"posts"}),
18
 *     @Index(name="last_login", columns={"last_login"}),
19
 *     @Index(name="lngfile", columns={"lngfile"}),
20
 *     @Index(name="id_post_group", columns={"id_post_group"}),
21
 *     @Index(name="warning", columns={"warning"}),
22
 *     @Index(name="total_time_logged_in", columns={"total_time_logged_in"}),
23
 *     @Index(name="id_theme", columns={"id_theme"})
24
 * })
25
 */
26
class MemberEntity implements MemberInterface
27
{
28
    /**
29
     * @var integer
30
     *
31
     * @Column(name="id_member", type="integer", nullable=false)
32
     * @Id
33
     */
34
    private $idMember;
35
36
    /**
37
     * @var string
38
     *
39
     * @Column(name="member_name", type="string", length=80, nullable=false)
40
     */
41
    private $memberName = '';
42
43
    /**
44
     * @var integer
45
     *
46
     * @Column(name="date_registered", type="integer", nullable=false)
47
     */
48
    private $dateRegistered = 0;
49
50
    /**
51
     * @var integer
52
     *
53
     * @Column(name="posts", type="integer", nullable=false)
54
     */
55
    private $posts = 0;
0 ignored issues
show
Unused Code introduced by
The property $posts 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...
56
57
    /**
58
     * @var integer
59
     *
60
     * @Column(name="id_group", type="smallint", nullable=false)
61
     */
62
    private $idGroup = 0;
0 ignored issues
show
Unused Code introduced by
The property $idGroup 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...
63
64
    /**
65
     * @var string
66
     *
67
     * @Column(name="lngfile", type="string", length=255, nullable=false)
68
     */
69
    private $lngfile = '';
0 ignored issues
show
Unused Code introduced by
The property $lngfile 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...
70
71
    /**
72
     * @var integer
73
     *
74
     * @Column(name="last_login", type="integer", nullable=false)
75
     */
76
    private $lastLogin = 0;
0 ignored issues
show
Unused Code introduced by
The property $lastLogin 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...
77
78
    /**
79
     * @var string
80
     *
81
     * @Column(name="real_name", type="string", length=255, nullable=false)
82
     */
83
    private $realName = '';
84
85
    /**
86
     * @var integer
87
     *
88
     * @Column(name="instant_messages", type="smallint", nullable=false)
89
     */
90
    private $instantMessages = 0;
0 ignored issues
show
Unused Code introduced by
The property $instantMessages 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...
91
92
    /**
93
     * @var integer
94
     *
95
     * @Column(name="unread_messages", type="smallint", nullable=false)
96
     */
97
    private $unreadMessages = 0;
0 ignored issues
show
Unused Code introduced by
The property $unreadMessages 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...
98
99
    /**
100
     * @var integer
101
     *
102
     * @Column(name="new_pm", type="smallint", nullable=false)
103
     */
104
    private $newPm = 0;
0 ignored issues
show
Unused Code introduced by
The property $newPm 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...
105
106
    /**
107
     * @var string
108
     *
109
     * @Column(name="buddy_list", type="text", nullable=false)
110
     */
111
    private $buddyList = '';
0 ignored issues
show
Unused Code introduced by
The property $buddyList 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...
112
113
    /**
114
     * @var string
115
     *
116
     * @Column(name="pm_ignore_list", type="string", length=255, nullable=false)
117
     */
118
    private $pmIgnoreList = '';
0 ignored issues
show
Unused Code introduced by
The property $pmIgnoreList 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...
119
120
    /**
121
     * @var integer
122
     *
123
     * @Column(name="pm_prefs", type="integer", nullable=false)
124
     */
125
    private $pmPrefs = 0;
0 ignored issues
show
Unused Code introduced by
The property $pmPrefs 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...
126
127
    /**
128
     * @var string
129
     *
130
     * @Column(name="mod_prefs", type="string", length=20, nullable=false)
131
     */
132
    private $modPrefs = '';
0 ignored issues
show
Unused Code introduced by
The property $modPrefs 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...
133
134
    /**
135
     * @var string
136
     *
137
     * @Column(name="message_labels", type="text", nullable=false)
138
     */
139
    private $messageLabels = '';
0 ignored issues
show
Unused Code introduced by
The property $messageLabels 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...
140
141
    /**
142
     * @var string
143
     *
144
     * @Column(name="passwd", type="string", length=64, nullable=false)
145
     */
146
    private $passwd = '';
147
148
    /**
149
     * @var string
150
     *
151
     * @Column(name="openid_uri", type="text", nullable=false)
152
     */
153
    private $openidUri = '';
0 ignored issues
show
Unused Code introduced by
The property $openidUri 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...
154
155
    /**
156
     * @var string
157
     *
158
     * @Column(name="email_address", type="string", length=255, nullable=false)
159
     */
160
    private $emailAddress = '';
161
162
    /**
163
     * @var string
164
     *
165
     * @Column(name="personal_text", type="string", length=255, nullable=false)
166
     */
167
    private $personalText = '';
0 ignored issues
show
Unused Code introduced by
The property $personalText 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...
168
169
    /**
170
     * @var integer
171
     *
172
     * @Column(name="gender", type="smallint", nullable=false)
173
     */
174
    private $gender = 0;
0 ignored issues
show
Unused Code introduced by
The property $gender 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...
175
176
//    /**
177
//     * @var \DateTime
178
//     *
179
//     * @Column(name="birthdate", type="date", nullable=false)
180
//     */
181
//    private $birthdate = '0001-01-01';
182
183
    /**
184
     * @var string
185
     *
186
     * @Column(name="website_title", type="string", length=255, nullable=false)
187
     */
188
    private $websiteTitle = '';
0 ignored issues
show
Unused Code introduced by
The property $websiteTitle 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...
189
190
    /**
191
     * @var string
192
     *
193
     * @Column(name="website_url", type="string", length=255, nullable=false)
194
     */
195
    private $websiteUrl = '';
0 ignored issues
show
Unused Code introduced by
The property $websiteUrl 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...
196
197
    /**
198
     * @var string
199
     *
200
     * @Column(name="location", type="string", length=255, nullable=false)
201
     */
202
    private $location = '';
0 ignored issues
show
Unused Code introduced by
The property $location 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...
203
204
    /**
205
     * @var string
206
     *
207
     * @Column(name="icq", type="string", length=255, nullable=false)
208
     */
209
    private $icq = '';
0 ignored issues
show
Unused Code introduced by
The property $icq 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...
210
211
    /**
212
     * @var string
213
     *
214
     * @Column(name="aim", type="string", length=255, nullable=false)
215
     */
216
    private $aim = '';
0 ignored issues
show
Unused Code introduced by
The property $aim 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...
217
218
    /**
219
     * @var string
220
     *
221
     * @Column(name="yim", type="string", length=32, nullable=false)
222
     */
223
    private $yim = '';
0 ignored issues
show
Unused Code introduced by
The property $yim 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...
224
225
    /**
226
     * @var string
227
     *
228
     * @Column(name="msn", type="string", length=255, nullable=false)
229
     */
230
    private $msn = '';
0 ignored issues
show
Unused Code introduced by
The property $msn 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...
231
232
    /**
233
     * @var boolean
234
     *
235
     * @Column(name="hide_email", type="boolean", nullable=false)
236
     */
237
    private $hideEmail = 1;
0 ignored issues
show
Unused Code introduced by
The property $hideEmail 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...
238
239
    /**
240
     * @var boolean
241
     *
242
     * @Column(name="show_online", type="boolean", nullable=false)
243
     */
244
    private $showOnline = 1;
0 ignored issues
show
Unused Code introduced by
The property $showOnline 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...
245
246
    /**
247
     * @var string
248
     *
249
     * @Column(name="time_format", type="string", length=80, nullable=false)
250
     */
251
    private $timeFormat = '';
0 ignored issues
show
Unused Code introduced by
The property $timeFormat 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...
252
253
    /**
254
     * @var string
255
     *
256
     * @Column(name="signature", type="text", nullable=false)
257
     */
258
    private $signature = '';
0 ignored issues
show
Unused Code introduced by
The property $signature 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...
259
260
    /**
261
     * @var float
262
     *
263
     * @Column(name="time_offset", type="float", precision=10, scale=0, nullable=false)
264
     */
265
    private $timeOffset = 0;
0 ignored issues
show
Unused Code introduced by
The property $timeOffset 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...
266
267
    /**
268
     * @var string
269
     *
270
     * @Column(name="avatar", type="string", length=255, nullable=false)
271
     */
272
    private $avatar = '';
273
274
    /**
275
     * @var boolean
276
     *
277
     * @Column(name="pm_email_notify", type="boolean", nullable=false)
278
     */
279
    private $pmEmailNotify = 0;
0 ignored issues
show
Unused Code introduced by
The property $pmEmailNotify 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...
280
281
    /**
282
     * @var integer
283
     *
284
     * @Column(name="karma_bad", type="smallint", nullable=false)
285
     */
286
    private $karmaBad = 0;
0 ignored issues
show
Unused Code introduced by
The property $karmaBad 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...
287
288
    /**
289
     * @var integer
290
     *
291
     * @Column(name="karma_good", type="smallint", nullable=false)
292
     */
293
    private $karmaGood = 0;
0 ignored issues
show
Unused Code introduced by
The property $karmaGood 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...
294
295
    /**
296
     * @var string
297
     *
298
     * @Column(name="usertitle", type="string", length=255, nullable=false)
299
     */
300
    private $usertitle = '';
0 ignored issues
show
Unused Code introduced by
The property $usertitle 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...
301
302
    /**
303
     * @var boolean
304
     *
305
     * @Column(name="notify_announcements", type="boolean", nullable=false)
306
     */
307
    private $notifyAnnouncements = 1;
0 ignored issues
show
Unused Code introduced by
The property $notifyAnnouncements 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...
308
309
    /**
310
     * @var integer
311
     *
312
     * @Column(name="notify_regularity", type="smallint", nullable=false)
313
     */
314
    private $notifyRegularity = 1;
0 ignored issues
show
Unused Code introduced by
The property $notifyRegularity 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...
315
316
    /**
317
     * @var boolean
318
     *
319
     * @Column(name="notify_send_body", type="boolean", nullable=false)
320
     */
321
    private $notifySendBody = 0;
0 ignored issues
show
Unused Code introduced by
The property $notifySendBody 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...
322
323
    /**
324
     * @var integer
325
     *
326
     * @Column(name="notify_types", type="smallint", nullable=false)
327
     */
328
    private $notifyTypes = 2;
0 ignored issues
show
Unused Code introduced by
The property $notifyTypes 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...
329
330
    /**
331
     * @var string
332
     *
333
     * @Column(name="member_ip", type="string", length=255, nullable=false)
334
     */
335
    private $memberIp = '';
0 ignored issues
show
Unused Code introduced by
The property $memberIp 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...
336
337
    /**
338
     * @var string
339
     *
340
     * @Column(name="member_ip2", type="string", length=255, nullable=false)
341
     */
342
    private $memberIp2 = '';
0 ignored issues
show
Unused Code introduced by
The property $memberIp2 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...
343
344
    /**
345
     * @var string
346
     *
347
     * @Column(name="secret_question", type="string", length=255, nullable=false)
348
     */
349
    private $secretQuestion = '';
0 ignored issues
show
Unused Code introduced by
The property $secretQuestion 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...
350
351
    /**
352
     * @var string
353
     *
354
     * @Column(name="secret_answer", type="string", length=64, nullable=false)
355
     */
356
    private $secretAnswer = '';
0 ignored issues
show
Unused Code introduced by
The property $secretAnswer 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...
357
358
    /**
359
     * @var integer
360
     *
361
     * @Column(name="id_theme", type="smallint", nullable=false)
362
     */
363
    private $idTheme = 0;
0 ignored issues
show
Unused Code introduced by
The property $idTheme 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...
364
365
    /**
366
     * @var boolean
367
     *
368
     * @Column(name="is_activated", type="boolean", nullable=false)
369
     */
370
    private $isActivated = 1;
0 ignored issues
show
Unused Code introduced by
The property $isActivated 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...
371
372
    /**
373
     * @var string
374
     *
375
     * @Column(name="validation_code", type="string", length=10, nullable=false)
376
     */
377
    private $validationCode = '';
0 ignored issues
show
Unused Code introduced by
The property $validationCode 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...
378
379
    /**
380
     * @var integer
381
     *
382
     * @Column(name="id_msg_last_visit", type="integer", nullable=false)
383
     */
384
    private $idMsgLastVisit = 0;
0 ignored issues
show
Unused Code introduced by
The property $idMsgLastVisit 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...
385
386
    /**
387
     * @var string
388
     *
389
     * @Column(name="additional_groups", type="string", length=255, nullable=false)
390
     */
391
    private $additionalGroups = '';
0 ignored issues
show
Unused Code introduced by
The property $additionalGroups 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...
392
393
    /**
394
     * @var string
395
     *
396
     * @Column(name="smiley_set", type="string", length=48, nullable=false)
397
     */
398
    private $smileySet = '';
0 ignored issues
show
Unused Code introduced by
The property $smileySet 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...
399
400
    /**
401
     * @var integer
402
     *
403
     * @Column(name="id_post_group", type="smallint", nullable=false)
404
     */
405
    private $idPostGroup = 0;
0 ignored issues
show
Unused Code introduced by
The property $idPostGroup 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...
406
407
    /**
408
     * @var integer
409
     *
410
     * @Column(name="total_time_logged_in", type="integer", nullable=false)
411
     */
412
    private $totalTimeLoggedIn = 0;
0 ignored issues
show
Unused Code introduced by
The property $totalTimeLoggedIn 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...
413
414
    /**
415
     * @var string
416
     *
417
     * @Column(name="password_salt", type="string", length=255, nullable=false)
418
     */
419
    private $passwordSalt = '';
420
421
    /**
422
     * @var string
423
     *
424
     * @Column(name="ignore_boards", type="text", nullable=false)
425
     */
426
    private $ignoreBoards = '';
0 ignored issues
show
Unused Code introduced by
The property $ignoreBoards 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...
427
428
    /**
429
     * @var integer
430
     *
431
     * @Column(name="warning", type="smallint", nullable=false)
432
     */
433
    private $warning = 0;
0 ignored issues
show
Unused Code introduced by
The property $warning 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...
434
435
    /**
436
     * @var string
437
     *
438
     * @Column(name="passwd_flood", type="string", length=12, nullable=false)
439
     */
440
    private $passwdFlood = '';
0 ignored issues
show
Unused Code introduced by
The property $passwdFlood 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...
441
442
    /**
443
     * @var integer
444
     *
445
     * @Column(name="pm_receive_from", type="smallint", nullable=false)
446
     */
447
    private $pmReceiveFrom = 1;
0 ignored issues
show
Unused Code introduced by
The property $pmReceiveFrom 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...
448
449
    /**
450
     * @return int
451
     */
452
    public function getId()
453
    {
454
        return $this->idMember;
455
    }
456
457
    /**
458
     * @param int $id
459
     * @return MemberEntity
460
     */
461
    public function setId($id)
462
    {
463
        $this->idMember = intval($id);
464
465
        return $this;
466
    }
467
468
    /**
469
     * @param string $nickname
470
     * @return MemberEntity
471
     */
472
    public function setNickname($nickname)
473
    {
474
        $this->memberName = strval($nickname);
475
476
        return $this;
477
    }
478
479
    /**
480
     * @return string
481
     */
482
    public function getNickname()
483
    {
484
        return $this->memberName;
485
    }
486
487
    /**
488
     * @param string $realName
489
     * @return MemberEntity
490
     */
491
    public function setRealName($realName)
492
    {
493
        $this->realName = strval($realName);
494
495
        return $this;
496
    }
497
498
    /**
499
     * @param \DateTime $dateTime
500
     * @return MemberEntity
501
     */
502
    public function setRegDate(\DateTime $dateTime)
503
    {
504
        $this->dateRegistered = $dateTime->getTimestamp();
505
506
        return $this;
507
    }
508
509
    /**
510
     * @param string $password
511
     * @return MemberEntity
512
     */
513
    public function setPassword($password)
514
    {
515
        $this->passwd = sha1(strtolower($this->memberName) . $password);
516
        $this->passwordSalt = substr(md5(mt_rand()), 0, 4);
517
518
        return $this;
519
    }
520
521
    /**
522
     * @param string $emailAddress
523
     * @return MemberEntity
524
     */
525
    public function setEmailAddress($emailAddress)
526
    {
527
        $this->emailAddress = strval($emailAddress);
528
529
        return $this;
530
    }
531
532
    /**
533
     * @param string $avatarUrl
534
     * @return MemberEntity
535
     */
536
    public function setAvatarUrl($avatarUrl)
537
    {
538
        $this->avatar = strval($avatarUrl);
539
540
        return $this;
541
    }
542
}
543