User   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 28
dl 0
loc 66
rs 10
c 0
b 0
f 0
wmc 11

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 2 1
A getShowEmail() 0 2 1
A getId() 0 2 1
A __construct() 0 24 3
A getJoinDate() 0 2 1
A getAvatar() 0 2 1
A getNewsCount() 0 2 1
A getKarma() 0 2 1
A getEmail() 0 2 1
1
<?php
2
namespace AL\Common\Model\User;
3
4
require_once __DIR__."/../../../config/config.php";
5
require_once __DIR__."/../../../lib/functions.php";
6
7
/**
8
 * Maps to the `user` table
9
 */
10
class User {
11
    private $id;
12
    private $name;
13
    private $email;
14
    private $join_date;
15
    private $karma;
16
    private $show_email;
17
    private $avatar;
18
    private $news_count;
19
20
    public function __construct(
21
        $id,
22
        $name,
23
        $email,
24
        $join_date,
25
        $karma,
26
        $show_email,
27
        $avatar_ext,
28
        $news_count = 0
29
    ) {
30
        $this->id = $id;
31
        $this->name = $name;
32
        $this->email = $email;
33
        $this->join_date = $join_date;
34
        $this->karma = $karma;
35
        $this->show_email = $show_email;
36
37
        if ($avatar_ext != null && $avatar_ext != '') {
38
            $this->avatar = $GLOBALS['user_avatar_path'].$id.'.'.$avatar_ext;
39
        } else {
40
            $this->avatar = "/themes/styles/1/images/default_avatar_image.png";
41
        }
42
43
        $this->news_count = $news_count;
44
    }
45
46
    public function getId() {
47
        return $this->id;
48
    }
49
50
    public function getName() {
51
        return $this->name;
52
    }
53
54
    public function getEmail() {
55
        return $this->email;
56
    }
57
58
    public function getJoinDate() {
59
        return $this->join_date;
60
    }
61
62
    public function getKarma() {
63
        return $this->karma;
64
    }
65
66
    public function getShowEmail() {
67
        return $this->show_email;
68
    }
69
70
    public function getAvatar() {
71
        return $this->avatar;
72
    }
73
74
    public function getNewsCount() {
75
        return $this->news_count;
76
    }
77
}
78