|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
GESTCONV - Aplicación web para la gestión de la convivencia en centros educativos |
|
4
|
|
|
|
|
5
|
|
|
Copyright (C) 2015: 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
|
|
|
|
|
24
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
25
|
|
|
use Doctrine\Common\Collections\Collection; |
|
26
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @ORM\Entity(repositoryClass="AppBundle\Entity\AlumnoRepository") |
|
30
|
|
|
*/ |
|
31
|
|
|
class Alumno |
|
32
|
|
|
{ |
|
33
|
|
|
/** |
|
34
|
|
|
* @ORM\Id |
|
35
|
|
|
* @ORM\Column(type="integer") |
|
36
|
|
|
* @ORM\GeneratedValue |
|
37
|
|
|
*/ |
|
38
|
|
|
protected $id; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @ORM\Column(type="integer", unique=true) |
|
42
|
|
|
* @var int |
|
43
|
|
|
*/ |
|
44
|
|
|
protected $nie; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @ORM\Column(type="string") |
|
48
|
|
|
* @var string |
|
49
|
|
|
*/ |
|
50
|
|
|
protected $nombre; |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @ORM\Column(type="string") |
|
54
|
|
|
* @var string |
|
55
|
|
|
*/ |
|
56
|
|
|
protected $apellido1; |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @ORM\Column(type="string", nullable=true) |
|
60
|
|
|
* @var string |
|
61
|
|
|
*/ |
|
62
|
|
|
protected $apellido2; |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @ORM\Column(type="date", nullable=true) |
|
66
|
|
|
* @var \DateTime |
|
67
|
|
|
*/ |
|
68
|
|
|
protected $fechaNacimiento; |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* @ORM\Column(type="string", nullable=true) |
|
72
|
|
|
* @var string |
|
73
|
|
|
*/ |
|
74
|
|
|
protected $tutor1; |
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @ORM\Column(type="string", nullable=true) |
|
78
|
|
|
* @var string |
|
79
|
|
|
*/ |
|
80
|
|
|
protected $tutor2; |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @ORM\Column(type="string", nullable=true) |
|
84
|
|
|
* @var string |
|
85
|
|
|
*/ |
|
86
|
|
|
protected $telefono1; |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* @ORM\Column(type="string", nullable=true) |
|
90
|
|
|
* @var string |
|
91
|
|
|
*/ |
|
92
|
|
|
protected $telefono2; |
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* @ORM\Column(type="string", nullable=true) |
|
96
|
|
|
* @var string |
|
97
|
|
|
*/ |
|
98
|
|
|
protected $notaTelefono1; |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* @ORM\Column(type="string", nullable=true) |
|
102
|
|
|
* @var string |
|
103
|
|
|
*/ |
|
104
|
|
|
protected $notaTelefono2; |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* @ORM\ManyToOne(targetEntity="Grupo", inversedBy="alumnado") |
|
108
|
|
|
* @ORM\JoinColumn(nullable=false) |
|
109
|
|
|
* @var Grupo |
|
110
|
|
|
*/ |
|
111
|
|
|
protected $grupo; |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* @ORM\OneToMany(targetEntity="Parte", mappedBy="alumno") |
|
115
|
|
|
* @var Collection |
|
116
|
|
|
*/ |
|
117
|
|
|
protected $partes = null; |
|
118
|
|
|
|
|
119
|
|
|
public function __construct() { |
|
120
|
|
|
$this->partes = new ArrayCollection(); |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
/** |
|
124
|
|
|
* |
|
125
|
|
|
* @return int |
|
126
|
|
|
*/ |
|
127
|
|
|
public function getId() |
|
128
|
|
|
{ |
|
129
|
|
|
return $this->id; |
|
130
|
|
|
} |
|
131
|
|
|
|
|
132
|
|
|
/** |
|
133
|
|
|
* |
|
134
|
|
|
* @return string |
|
135
|
|
|
*/ |
|
136
|
|
|
public function getApellido1() |
|
137
|
|
|
{ |
|
138
|
|
|
return $this->apellido1; |
|
139
|
|
|
} |
|
140
|
|
|
|
|
141
|
|
|
/** |
|
142
|
|
|
* |
|
143
|
|
|
* @param string $valor |
|
144
|
|
|
* @return Alumno |
|
145
|
|
|
*/ |
|
146
|
|
|
public function setApellido1($valor) |
|
147
|
|
|
{ |
|
148
|
|
|
$this->apellido1 = $valor; |
|
149
|
|
|
|
|
150
|
|
|
return $this; |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
/** |
|
154
|
|
|
* |
|
155
|
|
|
* @return string |
|
156
|
|
|
*/ |
|
157
|
|
|
public function getApellido2() |
|
158
|
|
|
{ |
|
159
|
|
|
return $this->apellido2; |
|
160
|
|
|
} |
|
161
|
|
|
|
|
162
|
|
|
/** |
|
163
|
|
|
* |
|
164
|
|
|
* @param string $valor |
|
165
|
|
|
* @return Alumno |
|
166
|
|
|
*/ |
|
167
|
|
|
public function setApellido2($valor) |
|
168
|
|
|
{ |
|
169
|
|
|
$this->apellido2 = $valor; |
|
170
|
|
|
|
|
171
|
|
|
return $this; |
|
172
|
|
|
} |
|
173
|
|
|
|
|
174
|
|
|
/** |
|
175
|
|
|
* |
|
176
|
|
|
* @return int |
|
177
|
|
|
*/ |
|
178
|
|
|
public function getNie() |
|
179
|
|
|
{ |
|
180
|
|
|
return $this->nie; |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
/** |
|
184
|
|
|
* |
|
185
|
|
|
* @param int $valor |
|
186
|
|
|
* @return Alumno |
|
187
|
|
|
*/ |
|
188
|
|
|
public function setNie($valor) |
|
189
|
|
|
{ |
|
190
|
|
|
$this->nie = $valor; |
|
191
|
|
|
|
|
192
|
|
|
return $this; |
|
193
|
|
|
} |
|
194
|
|
|
|
|
195
|
|
|
/** |
|
196
|
|
|
* |
|
197
|
|
|
* @return string |
|
198
|
|
|
*/ |
|
199
|
|
|
public function getNombreCompleto() { |
|
200
|
|
|
return $this->getApellidos() . ', ' . $this->getNombre(); |
|
201
|
|
|
} |
|
202
|
|
|
|
|
203
|
|
|
/** |
|
204
|
|
|
* |
|
205
|
|
|
* @return string |
|
206
|
|
|
*/ |
|
207
|
|
|
public function __toString() { |
|
208
|
|
|
return $this->getNombreCompleto() . ' (' . $this->getGrupo()->getDescripcion() . ')'; |
|
209
|
|
|
} |
|
210
|
|
|
|
|
211
|
|
|
/** |
|
212
|
|
|
* |
|
213
|
|
|
* @return string |
|
214
|
|
|
*/ |
|
215
|
|
|
public function getApellidos() |
|
216
|
|
|
{ |
|
217
|
|
|
return $this->apellido1 . (($this->apellido2) ? (' ' . $this->apellido2) : ''); |
|
218
|
|
|
} |
|
219
|
|
|
|
|
220
|
|
|
/** |
|
221
|
|
|
* |
|
222
|
|
|
* @return string |
|
223
|
|
|
*/ |
|
224
|
|
|
public function getNombre() |
|
225
|
|
|
{ |
|
226
|
|
|
return $this->nombre; |
|
227
|
|
|
} |
|
228
|
|
|
|
|
229
|
|
|
/** |
|
230
|
|
|
* |
|
231
|
|
|
* @param string $valor |
|
232
|
|
|
* @return Alumno |
|
233
|
|
|
*/ |
|
234
|
|
|
public function setNombre($valor) |
|
235
|
|
|
{ |
|
236
|
|
|
$this->nombre = $valor; |
|
237
|
|
|
|
|
238
|
|
|
return $this; |
|
239
|
|
|
} |
|
240
|
|
|
|
|
241
|
|
|
/** |
|
242
|
|
|
* Set grupo |
|
243
|
|
|
* |
|
244
|
|
|
* @param Grupo $grupo |
|
245
|
|
|
* @return Alumno |
|
246
|
|
|
*/ |
|
247
|
|
|
public function setGrupo(Grupo $grupo = null) |
|
248
|
|
|
{ |
|
249
|
|
|
$this->grupo = $grupo; |
|
250
|
|
|
|
|
251
|
|
|
return $this; |
|
252
|
|
|
} |
|
253
|
|
|
|
|
254
|
|
|
/** |
|
255
|
|
|
* Get grupo |
|
256
|
|
|
* |
|
257
|
|
|
* @return Grupo |
|
258
|
|
|
*/ |
|
259
|
|
|
public function getGrupo() |
|
260
|
|
|
{ |
|
261
|
|
|
return $this->grupo; |
|
262
|
|
|
} |
|
263
|
|
|
|
|
264
|
|
|
/** |
|
265
|
|
|
* Set tutor1 |
|
266
|
|
|
* |
|
267
|
|
|
* @param string $tutor1 |
|
268
|
|
|
* @return Alumno |
|
269
|
|
|
*/ |
|
270
|
|
|
public function setTutor1($tutor1) |
|
271
|
|
|
{ |
|
272
|
|
|
$this->tutor1 = $tutor1; |
|
273
|
|
|
|
|
274
|
|
|
return $this; |
|
275
|
|
|
} |
|
276
|
|
|
|
|
277
|
|
|
/** |
|
278
|
|
|
* Get tutor1 |
|
279
|
|
|
* |
|
280
|
|
|
* @return string |
|
281
|
|
|
*/ |
|
282
|
|
|
public function getTutor1() |
|
283
|
|
|
{ |
|
284
|
|
|
return $this->tutor1; |
|
285
|
|
|
} |
|
286
|
|
|
|
|
287
|
|
|
/** |
|
288
|
|
|
* Set tutor2 |
|
289
|
|
|
* |
|
290
|
|
|
* @param string $tutor2 |
|
291
|
|
|
* @return Alumno |
|
292
|
|
|
*/ |
|
293
|
|
|
public function setTutor2($tutor2) |
|
294
|
|
|
{ |
|
295
|
|
|
$this->tutor2 = $tutor2; |
|
296
|
|
|
|
|
297
|
|
|
return $this; |
|
298
|
|
|
} |
|
299
|
|
|
|
|
300
|
|
|
/** |
|
301
|
|
|
* Get tutor2 |
|
302
|
|
|
* |
|
303
|
|
|
* @return string |
|
304
|
|
|
*/ |
|
305
|
|
|
public function getTutor2() |
|
306
|
|
|
{ |
|
307
|
|
|
return $this->tutor2; |
|
308
|
|
|
} |
|
309
|
|
|
|
|
310
|
|
|
/** |
|
311
|
|
|
* Set telefono1 |
|
312
|
|
|
* |
|
313
|
|
|
* @param string $telefono1 |
|
314
|
|
|
* @return Alumno |
|
315
|
|
|
*/ |
|
316
|
|
|
public function setTelefono1($telefono1) |
|
317
|
|
|
{ |
|
318
|
|
|
$this->telefono1 = $telefono1; |
|
319
|
|
|
|
|
320
|
|
|
return $this; |
|
321
|
|
|
} |
|
322
|
|
|
|
|
323
|
|
|
/** |
|
324
|
|
|
* Get telefono1 |
|
325
|
|
|
* |
|
326
|
|
|
* @return string |
|
327
|
|
|
*/ |
|
328
|
|
|
public function getTelefono1() |
|
329
|
|
|
{ |
|
330
|
|
|
return $this->telefono1; |
|
331
|
|
|
} |
|
332
|
|
|
|
|
333
|
|
|
/** |
|
334
|
|
|
* Set telefono2 |
|
335
|
|
|
* |
|
336
|
|
|
* @param string $telefono2 |
|
337
|
|
|
* @return Alumno |
|
338
|
|
|
*/ |
|
339
|
|
|
public function setTelefono2($telefono2) |
|
340
|
|
|
{ |
|
341
|
|
|
$this->telefono2 = $telefono2; |
|
342
|
|
|
|
|
343
|
|
|
return $this; |
|
344
|
|
|
} |
|
345
|
|
|
|
|
346
|
|
|
/** |
|
347
|
|
|
* Get telefono2 |
|
348
|
|
|
* |
|
349
|
|
|
* @return string |
|
350
|
|
|
*/ |
|
351
|
|
|
public function getTelefono2() |
|
352
|
|
|
{ |
|
353
|
|
|
return $this->telefono2; |
|
354
|
|
|
} |
|
355
|
|
|
|
|
356
|
|
|
/** |
|
357
|
|
|
* Set notaTelefono1 |
|
358
|
|
|
* |
|
359
|
|
|
* @param string $notaTelefono1 |
|
360
|
|
|
* @return Alumno |
|
361
|
|
|
*/ |
|
362
|
|
|
public function setNotaTelefono1($notaTelefono1) |
|
363
|
|
|
{ |
|
364
|
|
|
$this->notaTelefono1 = $notaTelefono1; |
|
365
|
|
|
|
|
366
|
|
|
return $this; |
|
367
|
|
|
} |
|
368
|
|
|
|
|
369
|
|
|
/** |
|
370
|
|
|
* Get notaTelefono1 |
|
371
|
|
|
* |
|
372
|
|
|
* @return string |
|
373
|
|
|
*/ |
|
374
|
|
|
public function getNotaTelefono1() |
|
375
|
|
|
{ |
|
376
|
|
|
return $this->notaTelefono1; |
|
377
|
|
|
} |
|
378
|
|
|
|
|
379
|
|
|
/** |
|
380
|
|
|
* Set notaTelefono2 |
|
381
|
|
|
* |
|
382
|
|
|
* @param string $notaTelefono2 |
|
383
|
|
|
* @return Alumno |
|
384
|
|
|
*/ |
|
385
|
|
|
public function setNotaTelefono2($notaTelefono2) |
|
386
|
|
|
{ |
|
387
|
|
|
$this->notaTelefono2 = $notaTelefono2; |
|
388
|
|
|
|
|
389
|
|
|
return $this; |
|
390
|
|
|
} |
|
391
|
|
|
|
|
392
|
|
|
/** |
|
393
|
|
|
* Get notaTelefono2 |
|
394
|
|
|
* |
|
395
|
|
|
* @return string |
|
396
|
|
|
*/ |
|
397
|
|
|
public function getNotaTelefono2() |
|
398
|
|
|
{ |
|
399
|
|
|
return $this->notaTelefono2; |
|
400
|
|
|
} |
|
401
|
|
|
|
|
402
|
|
|
/** |
|
403
|
|
|
* Set fechaNacimiento |
|
404
|
|
|
* |
|
405
|
|
|
* @param \DateTime $fechaNacimiento |
|
406
|
|
|
* @return Alumno |
|
407
|
|
|
*/ |
|
408
|
|
|
public function setFechaNacimiento($fechaNacimiento) |
|
409
|
|
|
{ |
|
410
|
|
|
$this->fechaNacimiento = $fechaNacimiento; |
|
411
|
|
|
|
|
412
|
|
|
return $this; |
|
413
|
|
|
} |
|
414
|
|
|
|
|
415
|
|
|
/** |
|
416
|
|
|
* Get fechaNacimiento |
|
417
|
|
|
* |
|
418
|
|
|
* @return \DateTime |
|
419
|
|
|
*/ |
|
420
|
|
|
public function getFechaNacimiento() |
|
421
|
|
|
{ |
|
422
|
|
|
return $this->fechaNacimiento; |
|
423
|
|
|
} |
|
424
|
|
|
|
|
425
|
|
|
/** |
|
426
|
|
|
* Add partes |
|
427
|
|
|
* |
|
428
|
|
|
* @param Parte $partes |
|
429
|
|
|
* @return Alumno |
|
430
|
|
|
*/ |
|
431
|
|
|
public function addParte(Parte $partes) |
|
432
|
|
|
{ |
|
433
|
|
|
$this->partes[] = $partes; |
|
434
|
|
|
|
|
435
|
|
|
return $this; |
|
436
|
|
|
} |
|
437
|
|
|
|
|
438
|
|
|
/** |
|
439
|
|
|
* Remove partes |
|
440
|
|
|
* |
|
441
|
|
|
* @param Parte $partes |
|
442
|
|
|
*/ |
|
443
|
|
|
public function removeParte(Parte $partes) |
|
444
|
|
|
{ |
|
445
|
|
|
$this->partes->removeElement($partes); |
|
446
|
|
|
} |
|
447
|
|
|
|
|
448
|
|
|
/** |
|
449
|
|
|
* Get partes |
|
450
|
|
|
* |
|
451
|
|
|
* @return \Doctrine\Common\Collections\Collection |
|
452
|
|
|
*/ |
|
453
|
|
|
public function getPartes() |
|
454
|
|
|
{ |
|
455
|
|
|
return $this->partes; |
|
456
|
|
|
} |
|
457
|
|
|
} |
|
458
|
|
|
|