Completed
Push — master ( c714d2...ac9ca0 )
by Luis Ramón
15:07
created

Parte::getFechaCreacion()   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
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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
use Symfony\Component\Validator\Constraints as Assert;
28
29
30
/**
31
 * @ORM\Entity(repositoryClass="AppBundle\Entity\ParteRepository")
32
 */
33
class Parte
34
{
35
36
    /**
37
     * @ORM\Id
38
     * @ORM\Column(type="integer")
39
     * @ORM\GeneratedValue
40
     */
41
    protected $id;
42
    /**
43
     * @ORM\ManyToOne(targetEntity="Usuario", inversedBy="partes")
44
     * @ORM\JoinColumn(nullable=false)
45
     * @var Usuario
46
     *
47
     * @Assert\NotBlank()
48
     */
49
    protected $usuario;
50
    /**
51
     * @ORM\ManyToOne(targetEntity="Alumno", inversedBy="partes")
52
     * @ORM\JoinColumn(nullable=false)
53
     * @var Alumno
54
     */
55
    protected $alumno;
56
    /**
57
     * @ORM\Column(type="text", nullable=false)
58
     * @var string
59
     *
60
     * @Assert\Length(min="10", minMessage="parte.anotacion.min_length")
61
     */
62
    protected $anotacion;
63
    /**
64
     * @ORM\Column(type="text", nullable=true)
65
     * @var string
66
     *
67
     * @Assert\NotBlank(groups={"expulsion"}, message="parte.actividades.expulsion")
68
     */
69
    protected $actividades;
70
    /**
71
     * @ORM\Column(type="datetime", nullable=false)
72
     * @var \DateTime
73
     */
74
    protected $fechaCreacion;
75
    /**
76
     * @ORM\Column(type="datetime", nullable=false)
77
     * @var \DateTime
78
     *
79
     * @Assert\NotBlank(groups={"nuevo"}, message="parte.fecha_suceso.not_blank")
80
     * AssertDateRange(max="now +10 minute", maxMessage="parte.fecha_suceso.max")
81
     */
82
    protected $fechaSuceso;
83
    /**
84
     * @ORM\ManyToOne(targetEntity="TramoParte")
85
     * @ORM\JoinColumn(nullable=false)
86
     * @var TramoParte
87
     *
88
     * @Assert\NotBlank(groups={"nuevo"}, message="parte.tramo.not_blank")
89
     */
90
    protected $tramo;
91
    /**
92
     * @ORM\Column(type="datetime", nullable=true)
93
     * @var \DateTime
94
     */
95
    protected $fechaAviso;
96
    /**
97
     * @ORM\Column(type="datetime", nullable=true)
98
     * @var boolean
99
     */
100
    protected $fechaRecordatorio;
101
    /**
102
     * @ORM\Column(type="boolean", nullable=false)
103
     * @var boolean
104
     */
105
    protected $prescrito;
106
    /**
107
     * @ORM\Column(type="boolean", nullable=false)
108
     * @var boolean
109
     */
110
    protected $prioritario;
111
    /**
112
     * @ORM\Column(type="boolean", nullable=false)
113
     * @var boolean
114
     */
115
    protected $hayExpulsion;
116
    /**
117
     * @ORM\Column(type="boolean", nullable=true)
118
     * @var boolean
119
     */
120
    protected $actividadesRealizadas;
121
    /**
122
     * @ORM\ManyToMany(targetEntity="TipoConducta")
123
     * @var Collection
124
     *
125
     * @Assert\Count(min="1", minMessage="parte.conductas.min")
126
     */
127
    protected $conductas = null;
128
    /**
129
     * @ORM\ManyToOne(targetEntity="Sancion", inversedBy="partes")
130
     * @var Sancion
131
     */
132
    protected $sancion;
133
    /**
134
     * @ORM\OneToMany(targetEntity="ObservacionParte", mappedBy="parte")
135
     * @var Collection
136
     */
137
    protected $observaciones = null;
138
    /**
139
     * @ORM\OneToMany(targetEntity="AvisoParte", mappedBy="parte")
140
     * @var Collection
141
     */
142
    protected $avisos = null;
143
144
    /**
145
     * Constructor
146
     */
147
    public function __construct()
148
    {
149
        $this->conductas = new ArrayCollection();
150
        $this->observaciones = new ArrayCollection();
151
        $this->avisos = new ArrayCollection();
152
    }
153
154
    /**
155
     * Get id
156
     *
157
     * @return integer 
158
     */
159
    public function getId()
160
    {
161
        return $this->id;
162
    }
163
164
    /**
165
     * Set anotacion
166
     *
167
     * @param string $anotacion
168
     * @return Parte
169
     */
170
    public function setAnotacion($anotacion)
171
    {
172
        $this->anotacion = $anotacion;
173
174
        return $this;
175
    }
176
177
    /**
178
     * Get anotacion
179
     *
180
     * @return string 
181
     */
182
    public function getAnotacion()
183
    {
184
        return $this->anotacion;
185
    }
186
187
    /**
188
     * Set actividades
189
     *
190
     * @param string $actividades
191
     * @return Parte
192
     */
193
    public function setActividades($actividades)
194
    {
195
        $this->actividades = $actividades;
196
197
        return $this;
198
    }
199
200
    /**
201
     * Get actividades
202
     *
203
     * @return string 
204
     */
205
    public function getActividades()
206
    {
207
        return $this->actividades;
208
    }
209
210
    /**
211
     * Set fechaCreacion
212
     *
213
     * @param \DateTime $fechaCreacion
214
     * @return Parte
215
     */
216
    public function setFechaCreacion($fechaCreacion)
217
    {
218
        $this->fechaCreacion = $fechaCreacion;
219
220
        return $this;
221
    }
222
223
    /**
224
     * Get fechaCreacion
225
     *
226
     * @return \DateTime 
227
     */
228
    public function getFechaCreacion()
229
    {
230
        return $this->fechaCreacion;
231
    }
232
233
    /**
234
     * Set fechaSuceso
235
     *
236
     * @param \DateTime $fechaSuceso
237
     * @return Parte
238
     */
239
    public function setFechaSuceso($fechaSuceso)
240
    {
241
        $this->fechaSuceso = $fechaSuceso;
242
243
        return $this;
244
    }
245
246
    /**
247
     * Get fechaSuceso
248
     *
249
     * @return \DateTime
250
     */
251
    public function getFechaSuceso()
252
    {
253
        return $this->fechaSuceso;
254
    }
255
256
    /**
257
     * Set fechaAviso
258
     *
259
     * @param \DateTime $fechaAviso
260
     * @return Parte
261
     */
262
    public function setFechaAviso($fechaAviso)
263
    {
264
        $this->fechaAviso = $fechaAviso;
265
266
        return $this;
267
    }
268
269
    /**
270
     * Get fechaAviso
271
     *
272
     * @return \DateTime 
273
     */
274
    public function getFechaAviso()
275
    {
276
        return $this->fechaAviso;
277
    }
278
279
    /**
280
     * Set usuario
281
     *
282
     * @param Usuario $usuario
283
     * @return Parte
284
     */
285
    public function setUsuario(Usuario $usuario = null)
286
    {
287
        $this->usuario = $usuario;
288
289
        return $this;
290
    }
291
292
    /**
293
     * Get usuario
294
     *
295
     * @return Usuario
296
     */
297
    public function getUsuario()
298
    {
299
        return $this->usuario;
300
    }
301
302
    /**
303
     * Set alumno
304
     *
305
     * @param Alumno $alumno
306
     * @return Parte
307
     */
308
    public function setAlumno(Alumno $alumno = null)
309
    {
310
        $this->alumno = $alumno;
311
312
        return $this;
313
    }
314
315
    /**
316
     * Get alumno
317
     *
318
     * @return Alumno
319
     */
320
    public function getAlumno()
321
    {
322
        return $this->alumno;
323
    }
324
325
    /**
326
     * Set sancion
327
     *
328
     * @param Sancion $sancion
329
     * @return Parte
330
     */
331
    public function setSancion(Sancion $sancion = null)
332
    {
333
        $this->sancion = $sancion;
334
335
        return $this;
336
    }
337
338
    /**
339
     * Get sancion
340
     *
341
     * @return Sancion
342
     */
343
    public function getSancion()
344
    {
345
        return $this->sancion;
346
    }
347
348
    /**
349
     * Add observaciones
350
     *
351
     * @param ObservacionParte $observaciones
352
     * @return Parte
353
     */
354
    public function addObservacion(ObservacionParte $observaciones)
355
    {
356
        $this->observaciones[] = $observaciones;
357
358
        return $this;
359
    }
360
361
    /**
362
     * Remove observaciones
363
     *
364
     * @param ObservacionParte $observaciones
365
     */
366
    public function removeObservacion(ObservacionParte $observaciones)
367
    {
368
        $this->observaciones->removeElement($observaciones);
369
    }
370
371
    /**
372
     * Get observaciones
373
     *
374
     * @return Collection
375
     */
376
    public function getObservaciones()
377
    {
378
        return $this->observaciones;
379
    }
380
381
    /**
382
     * Add avisos
383
     *
384
     * @param AvisoParte $avisos
385
     * @return Parte
386
     */
387
    public function addAviso(AvisoParte $avisos)
388
    {
389
        $this->avisos[] = $avisos;
390
391
        return $this;
392
    }
393
394
    /**
395
     * Remove avisos
396
     *
397
     * @param AvisoParte $avisos
398
     */
399
    public function removeAviso(AvisoParte $avisos)
400
    {
401
        $this->avisos->removeElement($avisos);
402
    }
403
404
    /**
405
     * Get avisos
406
     *
407
     * @return Collection
408
     */
409
    public function getAvisos()
410
    {
411
        return $this->avisos;
412
    }
413
414
    /**
415
     * Set prescrito
416
     *
417
     * @param boolean $prescrito
418
     * @return Parte
419
     */
420
    public function setPrescrito($prescrito)
421
    {
422
        $this->prescrito = $prescrito;
423
424
        return $this;
425
    }
426
427
    /**
428
     * Get prescrito
429
     *
430
     * @return boolean 
431
     */
432
    public function getPrescrito()
433
    {
434
        return $this->prescrito;
435
    }
436
437
    /**
438
     * Set prioritario
439
     *
440
     * @param boolean $prioritario
441
     * @return Parte
442
     */
443
    public function setPrioritario($prioritario)
444
    {
445
        $this->prioritario = $prioritario;
446
447
        return $this;
448
    }
449
450
    /**
451
     * Get prioritario
452
     *
453
     * @return boolean
454
     */
455
    public function getPrioritario()
456
    {
457
        return $this->prioritario;
458
    }
459
460
    /**
461
     * Set fechaRecordatorio
462
     *
463
     * @param \DateTime $fechaRecordatorio
464
     * @return Parte
465
     */
466
    public function setFechaRecordatorio($fechaRecordatorio)
467
    {
468
        $this->fechaRecordatorio = $fechaRecordatorio;
0 ignored issues
show
Documentation Bug introduced by
It seems like $fechaRecordatorio of type object<DateTime> is incompatible with the declared type boolean of property $fechaRecordatorio.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
469
470
        return $this;
471
    }
472
473
    /**
474
     * Get fechaRecordatorio
475
     *
476
     * @return \DateTime
477
     */
478
    public function getFechaRecordatorio()
479
    {
480
        return $this->fechaRecordatorio;
481
    }
482
483
    /**
484
     * Set hayExpulsion
485
     *
486
     * @param boolean $hayExpulsion
487
     * @return Parte
488
     */
489
    public function setHayExpulsion($hayExpulsion)
490
    {
491
        $this->hayExpulsion = $hayExpulsion;
492
493
        return $this;
494
    }
495
496
    /**
497
     * Get hayExpulsion
498
     *
499
     * @return boolean
500
     */
501
    public function getHayExpulsion()
502
    {
503
        return $this->hayExpulsion;
504
    }
505
506
    /**
507
     * Set actividadesRealizadas
508
     *
509
     * @param boolean $actividadesRealizadas
510
     * @return Parte
511
     */
512
    public function setActividadesRealizadas($actividadesRealizadas)
513
    {
514
        $this->actividadesRealizadas = $actividadesRealizadas;
515
516
        return $this;
517
    }
518
519
    /**
520
     * Get actividadesRealizadas
521
     *
522
     * @return boolean
523
     */
524
    public function getActividadesRealizadas()
525
    {
526
        return $this->actividadesRealizadas;
527
    }
528
529
    /**
530
     * Set tramo
531
     *
532
     * @param TramoParte $tramo
533
     * @return Parte
534
     */
535
    public function setTramo(TramoParte $tramo = null)
536
    {
537
        $this->tramo = $tramo;
538
539
        return $this;
540
    }
541
542
    /**
543
     * Get tramo
544
     *
545
     * @return TramoParte
546
     */
547
    public function getTramo()
548
    {
549
        return $this->tramo;
550
    }
551
552
    /**
553
     * Add conductas
554
     *
555
     * @param TipoConducta $conductas
556
     * @return Parte
557
     */
558
    public function addConducta(TipoConducta $conductas)
559
    {
560
        $this->conductas[] = $conductas;
561
562
        return $this;
563
    }
564
565
    /**
566
     * Remove conductas
567
     *
568
     * @param TipoConducta $conductas
569
     */
570
    public function removeConducta(TipoConducta $conductas)
571
    {
572
        $this->conductas->removeElement($conductas);
573
    }
574
575
    /**
576
     * Get conductas
577
     *
578
     * @return Collection
579
     */
580
    public function getConductas()
581
    {
582
        return $this->conductas;
583
    }
584
585
    public function __toString()
586
    {
587
        return $this->getId() . ' - ' . $this->alumno . ' - ' . $this->getAnotacion();
588
    }
589
590
}
591