Completed
Pull Request — dev (#18)
by
unknown
05:20
created

Admin::getUsername()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
7
use Symfony\Component\Validator\Constraints as Assert;
8
9
/**
10
 * Admin.
11
 *
12
 * @ORM\Entity(repositoryClass="AppBundle\Repository\AdminRepository")
13
 */
14
class Admin
15
{
16
    use ORMBehaviors\Timestampable\Timestampable;
17
    /**
18
     * @var int
19
     *
20
     * @ORM\Column(type="integer")
21
     * @ORM\Id
22
     * @ORM\GeneratedValue(strategy="AUTO")
23
     */
24
    private $id;
25
26
    /**
27
     * @var string
28
     * @Assert\NotBlank()
29
     * @Assert\Type("string")
30
     * @Assert\Length(
31
     *      min = 2,
32
     *      max = 190
33
     * )
34
     * @ORM\Column(type="string", length=190, unique=true)
35
     */
36
    private $userName;
37
38
    /**
39
     * @var string
40
     * @Assert\Email(
41
     *     checkMX = true
42
     * )
43
     * @Assert\Type("string")
44
     * @Assert\Length(
45
     *      max = 250
46
     * )
47
     * @ORM\Column(type="string", length=250, unique=true)
48
     */
49
    private $email;
50
51
    /**
52
     * @var string
53
     * @Assert\NotBlank()
54
     * @Assert\Type("string")
55
     * @Assert\Length(
56
     *      max = 255
57
     * )
58
     * @ORM\Column(type="string", length=255)
59
     */
60
    private $password;
61
62
    /**
63
     * @var string
64
     */
65
    private $plainPassword;
66
67
    /**
68
     * @var
69
     * @ORM\Column(type="json_array")
70
     */
71
    protected $roles;
72
73
    public function __construct()
74
    {
75
        $this->roles = array('ROLE_ADMIN');
76
    }
77
78
    /**
79
     * Get id.
80
     *
81
     * @return int
82
     */
83
    public function getId()
84
    {
85
        return $this->id;
86
    }
87
88
    /**
89
     * Set username.
90
     *
91
     * @param string $name
92
     *
93
     * @return Admin
94
     */
95
    public function setUsername($name)
96
    {
97
        $this->userName = $name;
98
99
        return $this;
100
    }
101
102
    /**
103
     * Get name.
104
     *
105
     * @return string
106
     */
107
    public function getUsername()
108
    {
109
        return $this->userName;
110
    }
111
112
    /**
113
     * Set email.
114
     *
115
     * @param string $email
116
     *
117
     * @return Admin
118
     */
119
    public function setEmail($email)
120
    {
121
        $this->email = $email;
122
123
        return $this;
124
    }
125
126
    /**
127
     * Get email.
128
     *
129
     * @return string
130
     */
131
    public function getEmail()
132
    {
133
        return $this->email;
134
    }
135
136
    /**
137
     * Set password.
138
     *
139
     * @param string $password
140
     *
141
     * @return Admin
142
     */
143
    public function setPassword($password)
144
    {
145
        $this->password = $password;
146
147
        return $this;
148
    }
149
150
    /**
151
     * Get password.
152
     *
153
     * @return string
154
     */
155
    public function getPassword()
156
    {
157
        return $this->password;
158
    }
159
160
    /**
161
     * @return string
162
     */
163
    public function getPlainPassword()
164
    {
165
        return $this->plainPassword;
166
    }
167
168
    /**
169
     * @param string $plainPassword
170
     */
171
    public function setPlainPassword($plainPassword)
172
    {
173
        $this->plainPassword = $plainPassword;
174
    }
175
176
    /**
177
     * @param mixed $roles
178
     */
179
    public function setRoles($roles)
180
    {
181
        $this->roles = $roles;
182
    }
183
184
    /**
185
     * @return mixed
186
     */
187
    public function getRoles()
188
    {
189
        return $this->roles;
190
    }
191
}
192