User::setEmail()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace WebCMS\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @ORM\Entity
9
 * @property-read int $id
10
 * @property-read string $username
11
 * @property string $email
12
 * @property string $password
13
 * @property string $role
14
 */
15
class User extends Entity
16
{
17
    /**
18
     * @ORM\Column(unique=true)
19
     * @var string
20
     */
21
    private $username;
22
23
    /**
24
     * @ORM\Column
25
     * @var string
26
     */
27
    private $name;
28
29
    /**
30
     * @ORM\Column
31
     * @var string
32
     */
33
    private $email;
34
35
    /**
36
     * @ORM\Column
37
     * @var string
38
     */
39
    private $password;
40
41
    /**
42
     * @orm\ManyToOne(targetEntity="Role", fetch="EAGER")
43
     *
44
     * @orm\JoinColumn(name="role_id", referencedColumnName="id", onDelete="SET NULL")
45
     */
46
    private $role;
47
48
    /**
49
     * @return string
50
     */
51 42
    public function getUsername()
52
    {
53 42
        return $this->username;
54
    }
55
56
    /**
57
     * @return string
58
     */
59 42
    public function getPassword()
60
    {
61 42
        return $this->password;
62
    }
63
64
    /**
65
     * @param string
66
     * @return User
67
     */
68 43
    public function setPassword($password)
69
    {
70 43
        $this->password = $password;
71
72 43
        return $this;
73
    }
74
75
    /**
76
     * @return string
77
     */
78 42
    public function getEmail()
79
    {
80 42
        return $this->email;
81
    }
82
83
    /**
84
     * @param string
85
     * @param  string $email
86
     * @return User
87
     */
88 43
    public function setEmail($email)
89
    {
90 43
        $this->email = $email;
91
92 43
        return $this;
93
    }
94
95
    /**
96
     * @return Role
97
     */
98 42
    public function getRole()
99
    {
100 42
        return $this->role;
101
    }
102
103
    /**
104
     * @param string
105
     * @param  Role $role
106
     * @return User
107
     */
108 42
    public function setRole($role)
109
    {
110 42
        $this->role = $role;
111
112 42
        return $this;
113
    }
114
115 1
    public function getName()
116
    {
117 1
        return $this->name;
118
    }
119
120
    /**
121
     * @param string $name
122
     */
123 43
    public function setName($name)
124
    {
125 43
        $this->name = $name;
126 43
    }
127
128
    /**
129
     * @param string $username
130
     */
131 43
    public function setUsername($username)
132
    {
133 43
        $this->username = $username;
134 43
    }
135
}
136