|
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
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @ORM\Entity |
|
28
|
|
|
* @UniqueEntity(fields={"code"}) |
|
29
|
|
|
*/ |
|
30
|
|
|
class Company |
|
31
|
|
|
{ |
|
32
|
|
|
/** |
|
33
|
|
|
* @ORM\Id |
|
34
|
|
|
* @ORM\Column(type="integer") |
|
35
|
|
|
* @ORM\GeneratedValue |
|
36
|
|
|
* @var int |
|
37
|
|
|
*/ |
|
38
|
|
|
protected $id; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @ORM\Column(type="string") |
|
42
|
|
|
* @var string |
|
43
|
|
|
*/ |
|
44
|
|
|
protected $name; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @ORM\Column(type="string") |
|
48
|
|
|
* @var string |
|
49
|
|
|
*/ |
|
50
|
|
|
protected $code; |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @ORM\Column(type="string") |
|
54
|
|
|
* @var string |
|
55
|
|
|
*/ |
|
56
|
|
|
protected $address; |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @ORM\Column(type="string") |
|
60
|
|
|
* @var string |
|
61
|
|
|
*/ |
|
62
|
|
|
protected $city; |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @ORM\Column(type="string") |
|
66
|
|
|
* @var string |
|
67
|
|
|
*/ |
|
68
|
|
|
protected $province; |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* @ORM\Column(type="string") |
|
72
|
|
|
* @var string |
|
73
|
|
|
*/ |
|
74
|
|
|
protected $zipCode; |
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @ORM\Column(type="string", nullable=true) |
|
78
|
|
|
* @var string |
|
79
|
|
|
*/ |
|
80
|
|
|
protected $phoneNumber; |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @ORM\Column(type="string", nullable=true) |
|
84
|
|
|
* @var string |
|
85
|
|
|
*/ |
|
86
|
|
|
protected $email; |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* @ORM\ManyToOne(targetEntity="Person") |
|
90
|
|
|
* @ORM\JoinColumn(nullable=false) |
|
91
|
|
|
*/ |
|
92
|
|
|
protected $manager; |
|
93
|
|
|
|
|
94
|
|
|
public function __toString() |
|
95
|
|
|
{ |
|
96
|
|
|
return $this->getName() ? $this->getName() : ''; |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
/** |
|
100
|
|
|
* Get id |
|
101
|
|
|
* |
|
102
|
|
|
* @return integer |
|
103
|
|
|
*/ |
|
104
|
|
|
public function getId() |
|
105
|
|
|
{ |
|
106
|
|
|
return $this->id; |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
/** |
|
110
|
|
|
* Set code |
|
111
|
|
|
* |
|
112
|
|
|
* @param string $code |
|
113
|
|
|
* |
|
114
|
|
|
* @return Company |
|
115
|
|
|
*/ |
|
116
|
|
|
public function setCode($code) |
|
117
|
|
|
{ |
|
118
|
|
|
$this->code = $code; |
|
119
|
|
|
|
|
120
|
|
|
return $this; |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
/** |
|
124
|
|
|
* Get code |
|
125
|
|
|
* |
|
126
|
|
|
* @return string |
|
127
|
|
|
*/ |
|
128
|
|
|
public function getCode() |
|
129
|
|
|
{ |
|
130
|
|
|
return $this->code; |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
/** |
|
134
|
|
|
* Set address |
|
135
|
|
|
* |
|
136
|
|
|
* @param string $address |
|
137
|
|
|
* |
|
138
|
|
|
* @return Company |
|
139
|
|
|
*/ |
|
140
|
|
|
public function setAddress($address) |
|
141
|
|
|
{ |
|
142
|
|
|
$this->address = $address; |
|
143
|
|
|
|
|
144
|
|
|
return $this; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
/** |
|
148
|
|
|
* Get address |
|
149
|
|
|
* |
|
150
|
|
|
* @return string |
|
151
|
|
|
*/ |
|
152
|
|
|
public function getAddress() |
|
153
|
|
|
{ |
|
154
|
|
|
return $this->address; |
|
155
|
|
|
} |
|
156
|
|
|
|
|
157
|
|
|
/** |
|
158
|
|
|
* Set city |
|
159
|
|
|
* |
|
160
|
|
|
* @param string $city |
|
161
|
|
|
* |
|
162
|
|
|
* @return Company |
|
163
|
|
|
*/ |
|
164
|
|
|
public function setCity($city) |
|
165
|
|
|
{ |
|
166
|
|
|
$this->city = $city; |
|
167
|
|
|
|
|
168
|
|
|
return $this; |
|
169
|
|
|
} |
|
170
|
|
|
|
|
171
|
|
|
/** |
|
172
|
|
|
* Get city |
|
173
|
|
|
* |
|
174
|
|
|
* @return string |
|
175
|
|
|
*/ |
|
176
|
|
|
public function getCity() |
|
177
|
|
|
{ |
|
178
|
|
|
return $this->city; |
|
179
|
|
|
} |
|
180
|
|
|
|
|
181
|
|
|
/** |
|
182
|
|
|
* Set province |
|
183
|
|
|
* |
|
184
|
|
|
* @param string $province |
|
185
|
|
|
* |
|
186
|
|
|
* @return Company |
|
187
|
|
|
*/ |
|
188
|
|
|
public function setProvince($province) |
|
189
|
|
|
{ |
|
190
|
|
|
$this->province = $province; |
|
191
|
|
|
|
|
192
|
|
|
return $this; |
|
193
|
|
|
} |
|
194
|
|
|
|
|
195
|
|
|
/** |
|
196
|
|
|
* Get province |
|
197
|
|
|
* |
|
198
|
|
|
* @return string |
|
199
|
|
|
*/ |
|
200
|
|
|
public function getProvince() |
|
201
|
|
|
{ |
|
202
|
|
|
return $this->province; |
|
203
|
|
|
} |
|
204
|
|
|
|
|
205
|
|
|
/** |
|
206
|
|
|
* Set zipCode |
|
207
|
|
|
* |
|
208
|
|
|
* @param string $zipCode |
|
209
|
|
|
* |
|
210
|
|
|
* @return Company |
|
211
|
|
|
*/ |
|
212
|
|
|
public function setZipCode($zipCode) |
|
213
|
|
|
{ |
|
214
|
|
|
$this->zipCode = $zipCode; |
|
215
|
|
|
|
|
216
|
|
|
return $this; |
|
217
|
|
|
} |
|
218
|
|
|
|
|
219
|
|
|
/** |
|
220
|
|
|
* Get zipCode |
|
221
|
|
|
* |
|
222
|
|
|
* @return string |
|
223
|
|
|
*/ |
|
224
|
|
|
public function getZipCode() |
|
225
|
|
|
{ |
|
226
|
|
|
return $this->zipCode; |
|
227
|
|
|
} |
|
228
|
|
|
|
|
229
|
|
|
/** |
|
230
|
|
|
* Set phoneNumber |
|
231
|
|
|
* |
|
232
|
|
|
* @param string $phoneNumber |
|
233
|
|
|
* |
|
234
|
|
|
* @return Company |
|
235
|
|
|
*/ |
|
236
|
|
|
public function setPhoneNumber($phoneNumber) |
|
237
|
|
|
{ |
|
238
|
|
|
$this->phoneNumber = $phoneNumber; |
|
239
|
|
|
|
|
240
|
|
|
return $this; |
|
241
|
|
|
} |
|
242
|
|
|
|
|
243
|
|
|
/** |
|
244
|
|
|
* Get phoneNumber |
|
245
|
|
|
* |
|
246
|
|
|
* @return string |
|
247
|
|
|
*/ |
|
248
|
|
|
public function getPhoneNumber() |
|
249
|
|
|
{ |
|
250
|
|
|
return $this->phoneNumber; |
|
251
|
|
|
} |
|
252
|
|
|
|
|
253
|
|
|
/** |
|
254
|
|
|
* Set email |
|
255
|
|
|
* |
|
256
|
|
|
* @param string $email |
|
257
|
|
|
* |
|
258
|
|
|
* @return Company |
|
259
|
|
|
*/ |
|
260
|
|
|
public function setEmail($email) |
|
261
|
|
|
{ |
|
262
|
|
|
$this->email = $email; |
|
263
|
|
|
|
|
264
|
|
|
return $this; |
|
265
|
|
|
} |
|
266
|
|
|
|
|
267
|
|
|
/** |
|
268
|
|
|
* Get email |
|
269
|
|
|
* |
|
270
|
|
|
* @return string |
|
271
|
|
|
*/ |
|
272
|
|
|
public function getEmail() |
|
273
|
|
|
{ |
|
274
|
|
|
return $this->email; |
|
275
|
|
|
} |
|
276
|
|
|
|
|
277
|
|
|
/** |
|
278
|
|
|
* Set manager |
|
279
|
|
|
* |
|
280
|
|
|
* @param Person $manager |
|
281
|
|
|
* |
|
282
|
|
|
* @return Company |
|
283
|
|
|
*/ |
|
284
|
|
|
public function setManager(Person $manager) |
|
285
|
|
|
{ |
|
286
|
|
|
$this->manager = $manager; |
|
287
|
|
|
|
|
288
|
|
|
return $this; |
|
289
|
|
|
} |
|
290
|
|
|
|
|
291
|
|
|
/** |
|
292
|
|
|
* Get manager |
|
293
|
|
|
* |
|
294
|
|
|
* @return Person |
|
295
|
|
|
*/ |
|
296
|
|
|
public function getManager() |
|
297
|
|
|
{ |
|
298
|
|
|
return $this->manager; |
|
299
|
|
|
} |
|
300
|
|
|
|
|
301
|
|
|
/** |
|
302
|
|
|
* Set name |
|
303
|
|
|
* |
|
304
|
|
|
* @param string $name |
|
305
|
|
|
* |
|
306
|
|
|
* @return Company |
|
307
|
|
|
*/ |
|
308
|
|
|
public function setName($name) |
|
309
|
|
|
{ |
|
310
|
|
|
$this->name = $name; |
|
311
|
|
|
|
|
312
|
|
|
return $this; |
|
313
|
|
|
} |
|
314
|
|
|
|
|
315
|
|
|
/** |
|
316
|
|
|
* Get name |
|
317
|
|
|
* |
|
318
|
|
|
* @return string |
|
319
|
|
|
*/ |
|
320
|
|
|
public function getName() |
|
321
|
|
|
{ |
|
322
|
|
|
return $this->name; |
|
323
|
|
|
} |
|
324
|
|
|
} |
|
325
|
|
|
|