GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — user-entity ( 6db575...67b804 )
by Luis Ramón
02:52
created

Person::setInitials()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/*
3
  ÁTICA - Aplicación web para la gestión documental de centros educativos
4
5
  Copyright (C) 2015-2016: Luis Ramón López López
6
7
  This program is free software: you can redistribute it and/or modify
8
  it under the terms of the GNU Affero General Public License as published by
9
  the Free Software Foundation, either version 3 of the License, or
10
  (at your option) any later version.
11
12
  This program is distributed in the hope that it will be useful,
13
  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
  GNU Affero General Public License for more details.
16
17
  You should have received a copy of the GNU Affero General Public License
18
  along with this program.  If not, see [http://www.gnu.org/licenses/].
19
*/
20
21
namespace AppBundle\Entity;
22
23
use Doctrine\ORM\Mapping as ORM;
24
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
25
use Symfony\Component\Validator\Constraints as Assert;
26
27
/**
28
 * @ORM\MappedSuperclass
29
 * @UniqueEntity("email")
30
 */
31
class Person
32
{
33
    const GENDER_UNKNOWN = 0;
34
    const GENDER_MALE = 1;
35
    const GENDER_FEMALE = 2;
36
37
    /**
38
     * @ORM\Column(type="string", unique=true, nullable=true)
39
     * @var string
40
     */
41
    protected $reference;
42
43
    /**
44
     * @ORM\Column(type="string")
45
     * @Assert\NotBlank()
46
     * @var string
47
     */
48
    protected $firstName;
49
50
    /**
51
     * @ORM\Column(type="string")
52
     * @Assert\NotBlank()
53
     * @var string
54
     */
55
    protected $lastName;
56
57
    /**
58
     * @ORM\Column(type="integer")
59
     * @var int
60
     */
61
    protected $gender;
62
63
    /**
64
     * @ORM\Column(type="string", nullable=true)
65
     * @var string
66
     */
67
    protected $displayName;
68
69
    /**
70
     * @ORM\Column(type="string", nullable=true)
71
     * @var string
72
     */
73
    protected $address;
74
75
    /**
76
     * @ORM\Column(type="string", nullable=true)
77
     * @var string
78
     */
79
    protected $city;
80
81
    /**
82
     * @ORM\Column(type="string", nullable=true)
83
     * @var string
84
     */
85
    protected $province;
86
87
    /**
88
     * @ORM\Column(type="string", nullable=true)
89
     * @var string
90
     */
91
    protected $zipCode;
92
93
    /**
94
     * @ORM\Column(type="string", nullable=true)
95
     * @var string
96
     */
97
    protected $phoneNumber;
98
99
    /**
100
     * @ORM\Column(type="string", unique=true, nullable=true)
101
     * @Assert\Email()
102
     * @var string
103
     */
104
    protected $email;
105
106
    public function __construct()
107
    {
108
        $this->gender = self::GENDER_UNKNOWN;
109
    }
110
111
    /**
112
     * Returns the person's display name
113
     *
114
     * @return string
115
     */
116
    public function __toString()
117
    {
118
        $displayName = $this->getDisplayName() ?: $this->getFirstName() . ' ' . $this->getLastName();
119
        
120
        return $this->getLastName() ? $displayName : '';
121
    }
122
123
    /**
124
     * Set reference
125
     *
126
     * @param string $reference
127
     *
128
     * @return User
129
     */
130
    public function setReference($reference)
131
    {
132
        $this->reference = $reference;
133
134
        return $this;
135
    }
136
137
    /**
138
     * Get reference
139
     *
140
     * @return string
141
     */
142
    public function getReference()
143
    {
144
        return $this->reference;
145
    }
146
147
    /**
148
     * Set firstName
149
     *
150
     * @param string $firstName
151
     *
152
     * @return User
153
     */
154
    public function setFirstName($firstName)
155
    {
156
        $this->firstName = $firstName;
157
158
        return $this;
159
    }
160
161
    /**
162
     * Get firstName
163
     *
164
     * @return string
165
     */
166
    public function getFirstName()
167
    {
168
        return $this->firstName;
169
    }
170
171
    /**
172
     * Set lastName
173
     *
174
     * @param string $lastName
175
     *
176
     * @return User
177
     */
178
    public function setLastName($lastName)
179
    {
180
        $this->lastName = $lastName;
181
182
        return $this;
183
    }
184
185
    /**
186
     * Get lastName
187
     *
188
     * @return string
189
     */
190
    public function getLastName()
191
    {
192
        return $this->lastName;
193
    }
194
195
    /**
196
     * Set gender
197
     *
198
     * @param integer $gender
199
     *
200
     * @return User
201
     */
202
    public function setGender($gender)
203
    {
204
        $this->gender = $gender;
205
206
        return $this;
207
    }
208
209
    /**
210
     * Get gender
211
     *
212
     * @return integer
213
     */
214
    public function getGender()
215
    {
216
        return $this->gender;
217
    }
218
219
    /**
220
     * Set displayName
221
     *
222
     * @param string $displayName
223
     *
224
     * @return User
225
     */
226
    public function setDisplayName($displayName)
227
    {
228
        $this->displayName = $displayName;
229
230
        return $this;
231
    }
232
233
    /**
234
     * Get displayName
235
     *
236
     * @return string
237
     */
238
    public function getDisplayName()
239
    {
240
        return $this->displayName;
241
    }
242
243
    /**
244
     * Set address
245
     *
246
     * @param string $address
247
     *
248
     * @return User
249
     */
250
    public function setAddress($address)
251
    {
252
        $this->address = $address;
253
254
        return $this;
255
    }
256
257
    /**
258
     * Get address
259
     *
260
     * @return string
261
     */
262
    public function getAddress()
263
    {
264
        return $this->address;
265
    }
266
267
    /**
268
     * Set city
269
     *
270
     * @param string $city
271
     *
272
     * @return User
273
     */
274
    public function setCity($city)
275
    {
276
        $this->city = $city;
277
278
        return $this;
279
    }
280
281
    /**
282
     * Get city
283
     *
284
     * @return string
285
     */
286
    public function getCity()
287
    {
288
        return $this->city;
289
    }
290
291
    /**
292
     * Set province
293
     *
294
     * @param string $province
295
     *
296
     * @return User
297
     */
298
    public function setProvince($province)
299
    {
300
        $this->province = $province;
301
302
        return $this;
303
    }
304
305
    /**
306
     * Get province
307
     *
308
     * @return string
309
     */
310
    public function getProvince()
311
    {
312
        return $this->province;
313
    }
314
315
    /**
316
     * Set zipCode
317
     *
318
     * @param string $zipCode
319
     *
320
     * @return User
321
     */
322
    public function setZipCode($zipCode)
323
    {
324
        $this->zipCode = $zipCode;
325
326
        return $this;
327
    }
328
329
    /**
330
     * Get zipCode
331
     *
332
     * @return string
333
     */
334
    public function getZipCode()
335
    {
336
        return $this->zipCode;
337
    }
338
339
    /**
340
     * Set phoneNumber
341
     *
342
     * @param string $phoneNumber
343
     *
344
     * @return User
345
     */
346
    public function setPhoneNumber($phoneNumber)
347
    {
348
        $this->phoneNumber = $phoneNumber;
349
350
        return $this;
351
    }
352
353
    /**
354
     * Get phoneNumber
355
     *
356
     * @return string
357
     */
358
    public function getPhoneNumber()
359
    {
360
        return $this->phoneNumber;
361
    }
362
363
364
    /**
365
     * Get email
366
     *
367
     * @return string
368
     */
369
    public function getEmail()
370
    {
371
        return $this->email;
372
    }
373
374
    /**
375
     * Set email
376
     *
377
     * @param string $email
378
     *
379
     * @return User
380
     */
381
    public function setEmail($email)
382
    {
383
        $this->email = $email;
384
385
        return $this;
386
    }
387
}
388