|
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\Form\Model; |
|
22
|
|
|
|
|
23
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
|
24
|
|
|
use Symfony\Component\Validator\Context\ExecutionContextInterface; |
|
25
|
|
|
|
|
26
|
|
|
class Attendance |
|
27
|
|
|
{ |
|
28
|
|
|
/** |
|
29
|
|
|
* @Assert\Regex(pattern="/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/") |
|
30
|
|
|
* @Assert\NotBlank() |
|
31
|
|
|
* @var string |
|
32
|
|
|
*/ |
|
33
|
|
|
protected $startTime1; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @Assert\Regex(pattern="/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/") |
|
37
|
|
|
* @Assert\NotBlank() |
|
38
|
|
|
* @var string |
|
39
|
|
|
*/ |
|
40
|
|
|
protected $endTime1; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @Assert\Regex(pattern="/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/") |
|
44
|
|
|
* @var string |
|
45
|
|
|
*/ |
|
46
|
|
|
protected $startTime2; |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* @Assert\Regex(pattern="/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/") |
|
50
|
|
|
* @var string |
|
51
|
|
|
*/ |
|
52
|
|
|
protected $endTime2; |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* @Assert\Regex(pattern="/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/") |
|
56
|
|
|
* @var string |
|
57
|
|
|
*/ |
|
58
|
|
|
protected $startTime3; |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @Assert\Regex(pattern="/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/") |
|
62
|
|
|
* @var string |
|
63
|
|
|
*/ |
|
64
|
|
|
protected $endTime3; |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @var \DateTime |
|
68
|
|
|
*/ |
|
69
|
|
|
protected $signDate; |
|
70
|
|
|
|
|
71
|
|
|
|
|
72
|
|
|
public function __construct() |
|
73
|
|
|
{ |
|
74
|
|
|
$this->signDate = new \DateTime(); |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* @return string |
|
79
|
|
|
*/ |
|
80
|
|
|
public function getStartTime1() |
|
81
|
|
|
{ |
|
82
|
|
|
return $this->startTime1; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* @param string $startTime1 |
|
87
|
|
|
* @return Attendance |
|
88
|
|
|
*/ |
|
89
|
|
|
public function setStartTime1($startTime1) |
|
90
|
|
|
{ |
|
91
|
|
|
$this->startTime1 = $startTime1; |
|
92
|
|
|
return $this; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* @return string |
|
97
|
|
|
*/ |
|
98
|
|
|
public function getEndTime1() |
|
99
|
|
|
{ |
|
100
|
|
|
return $this->endTime1; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* @param string $endTime1 |
|
105
|
|
|
* @return Attendance |
|
106
|
|
|
*/ |
|
107
|
|
|
public function setEndTime1($endTime1) |
|
108
|
|
|
{ |
|
109
|
|
|
$this->endTime1 = $endTime1; |
|
110
|
|
|
return $this; |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* @return string |
|
115
|
|
|
*/ |
|
116
|
|
|
public function getStartTime2() |
|
117
|
|
|
{ |
|
118
|
|
|
return $this->startTime2; |
|
119
|
|
|
} |
|
120
|
|
|
|
|
121
|
|
|
/** |
|
122
|
|
|
* @param string $startTime2 |
|
123
|
|
|
* @return Attendance |
|
124
|
|
|
*/ |
|
125
|
|
|
public function setStartTime2($startTime2) |
|
126
|
|
|
{ |
|
127
|
|
|
$this->startTime2 = $startTime2; |
|
128
|
|
|
return $this; |
|
129
|
|
|
} |
|
130
|
|
|
|
|
131
|
|
|
/** |
|
132
|
|
|
* @return string |
|
133
|
|
|
*/ |
|
134
|
|
|
public function getEndTime2() |
|
135
|
|
|
{ |
|
136
|
|
|
return $this->endTime2; |
|
137
|
|
|
} |
|
138
|
|
|
|
|
139
|
|
|
/** |
|
140
|
|
|
* @param string $endTime2 |
|
141
|
|
|
* @return Attendance |
|
142
|
|
|
*/ |
|
143
|
|
|
public function setEndTime2($endTime2) |
|
144
|
|
|
{ |
|
145
|
|
|
$this->endTime2 = $endTime2; |
|
146
|
|
|
return $this; |
|
147
|
|
|
} |
|
148
|
|
|
|
|
149
|
|
|
/** |
|
150
|
|
|
* @return string |
|
151
|
|
|
*/ |
|
152
|
|
|
public function getStartTime3() |
|
153
|
|
|
{ |
|
154
|
|
|
return $this->startTime3; |
|
155
|
|
|
} |
|
156
|
|
|
|
|
157
|
|
|
/** |
|
158
|
|
|
* @param string $startTime3 |
|
159
|
|
|
* @return Attendance |
|
160
|
|
|
*/ |
|
161
|
|
|
public function setStartTime3($startTime3) |
|
162
|
|
|
{ |
|
163
|
|
|
$this->startTime3 = $startTime3; |
|
164
|
|
|
return $this; |
|
165
|
|
|
} |
|
166
|
|
|
|
|
167
|
|
|
/** |
|
168
|
|
|
* @return string |
|
169
|
|
|
*/ |
|
170
|
|
|
public function getEndTime3() |
|
171
|
|
|
{ |
|
172
|
|
|
return $this->endTime3; |
|
173
|
|
|
} |
|
174
|
|
|
|
|
175
|
|
|
/** |
|
176
|
|
|
* @param string $endTime3 |
|
177
|
|
|
* @return Attendance |
|
178
|
|
|
*/ |
|
179
|
|
|
public function setEndTime3($endTime3) |
|
180
|
|
|
{ |
|
181
|
|
|
$this->endTime3 = $endTime3; |
|
182
|
|
|
return $this; |
|
183
|
|
|
} |
|
184
|
|
|
|
|
185
|
|
|
/** |
|
186
|
|
|
* @return \DateTime |
|
187
|
|
|
*/ |
|
188
|
|
|
public function getSignDate() |
|
189
|
|
|
{ |
|
190
|
|
|
return $this->signDate; |
|
191
|
|
|
} |
|
192
|
|
|
|
|
193
|
|
|
/** |
|
194
|
|
|
* @param \DateTime $signDate |
|
195
|
|
|
* @return Attendance |
|
196
|
|
|
*/ |
|
197
|
|
|
public function setSignDate($signDate) |
|
198
|
|
|
{ |
|
199
|
|
|
$this->signDate = $signDate; |
|
200
|
|
|
return $this; |
|
201
|
|
|
} |
|
202
|
|
|
|
|
203
|
|
|
/** |
|
204
|
|
|
* @Assert\Callback |
|
205
|
|
|
*/ |
|
206
|
|
|
public function validate(ExecutionContextInterface $context) |
|
|
|
|
|
|
207
|
|
|
{ |
|
208
|
|
|
// Add validation later |
|
209
|
|
|
} |
|
210
|
|
|
|
|
211
|
|
|
} |
|
212
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.