[+BUGFIX] Extbase (Persistence): Fixed a problem with empty $fieldValue causing an...
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Domain / Model / FrontendUser.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25 /**
26 * A Frontend User
27 *
28 * @package Extbase
29 * @subpackage Domain\Model
30 * @version $Id: $
31 * @scope prototype
32 * @entity
33 */
34 class Tx_Extbase_Domain_Model_FrontendUser extends Tx_Extbase_DomainObject_AbstractEntity {
35
36 /**
37 * @var string
38 */
39 protected $username;
40
41 /**
42 * @var string
43 */
44 protected $password;
45
46 /**
47 * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FrontendUserGroup>
48 */
49 protected $usergroups;
50
51 /**
52 * @var string
53 */
54 protected $name;
55
56 /**
57 * @var string
58 */
59 protected $address = '';
60
61 /**
62 * @var string
63 */
64 protected $telephone = '';
65
66 /**
67 * @var string
68 */
69 protected $fax = '';
70
71 /**
72 * @var string
73 */
74 protected $email = '';
75
76 /**
77 * @var string
78 */
79 protected $lockToDomain = '';
80
81 /**
82 * @var string
83 */
84 protected $title = '';
85
86 /**
87 * @var string
88 */
89 protected $zip = '';
90
91 /**
92 * @var string
93 */
94 protected $city = '';
95
96 /**
97 * @var string
98 */
99 protected $country = '';
100
101 /**
102 * @var string
103 */
104 protected $www = '';
105
106 /**
107 * @var string
108 */
109 protected $company = '';
110
111 /**
112 * @var string
113 */
114 protected $image = '';
115
116 /**
117 * @var DateTime
118 */
119 protected $lastlogin = '';
120
121 /**
122 * @var DateTime
123 */
124 protected $isOnline = '';
125
126 /**
127 * Constructs a new Front-End User
128 *
129 * @api
130 */
131 public function __construct($username = '', $password = '') {
132 $this->username = $username;
133 $this->password = $password;
134 $this->usergroups = new Tx_Extbase_Persistence_ObjectStorage();
135 }
136
137 /**
138 * Sets the username value
139 *
140 * @param string $username
141 * @return void
142 * @api
143 */
144 public function setUsername($username) {
145 $this->username = $username;
146 }
147
148 /**
149 * Returns the username value
150 *
151 * @return string
152 * @api
153 */
154 public function getUsername() {
155 return $this->username;
156 }
157
158 /**
159 * Sets the password value
160 *
161 * @param string $password
162 * @return void
163 * @api
164 */
165 public function setPassword($password) {
166 $this->password = $password;
167 }
168
169 /**
170 * Returns the password value
171 *
172 * @return string
173 * @api
174 */
175 public function getPassword() {
176 return $this->password;
177 }
178
179 /**
180 * Sets the usergroups
181 *
182 * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FrontendUserGroup> $usergroups An object storage containing the usergroups to add
183 * @return void
184 * @api
185 */
186 public function setUsergroups(Tx_Extbase_Persistence_ObjectStorage $usergroups) {
187 $this->usergroups = $usergroups;
188 }
189
190 /**
191 * Adds a usergroup to the frontend user
192 *
193 * @param Tx_Extbase_Domain_Model_FrontendUserGroup $usergroup
194 * @return void
195 * @api
196 */
197 public function addUsergroup(Tx_Extbase_Domain_Model_FrontendUserGroup $usergroup) {
198 $this->usergroups->attach($usergroup);
199 }
200
201 /**
202 * Removes a usergroup from the frontend user
203 *
204 * @param Tx_Extbase_Domain_Model_FrontendUserGroup $usergroup
205 * @return void
206 * @api
207 */
208 public function removeUsergroup(Tx_Extbase_Domain_Model_FrontendUserGroup $usergroup) {
209 $this->usergroups->detach($usergroup);
210 }
211
212 /**
213 * Returns the usergroups
214 *
215 * @return Tx_Extbase_Persistence_ObjectStorage An object storage containing the usergroups
216 * @api
217 */
218 public function getUsergroups() {
219 return $this->usergroups;
220 }
221
222 /**
223 * Sets the name value
224 *
225 * @param string $name
226 * @return void
227 * @api
228 */
229 public function setName($name) {
230 $this->name = $name;
231 }
232
233 /**
234 * Returns the name value
235 *
236 * @return string
237 * @api
238 */
239 public function getName() {
240 return $this->name;
241 }
242
243 /**
244 * Sets the address value
245 *
246 * @param string $address
247 * @return void
248 * @api
249 */
250 public function setAddress($address) {
251 $this->address = $address;
252 }
253
254 /**
255 * Returns the address value
256 *
257 * @return string
258 * @api
259 */
260 public function getAddress() {
261 return $this->address;
262 }
263
264 /**
265 * Sets the telephone value
266 *
267 * @param string $telephone
268 * @return void
269 * @api
270 */
271 public function setTelephone($telephone) {
272 $this->telephone = $telephone;
273 }
274
275 /**
276 * Returns the telephone value
277 *
278 * @return string
279 * @api
280 */
281 public function getTelephone() {
282 return $this->telephone;
283 }
284
285 /**
286 * Sets the fax value
287 *
288 * @param string $fax
289 * @return void
290 * @api
291 */
292 public function setFax($fax) {
293 $this->fax = $fax;
294 }
295
296 /**
297 * Returns the fax value
298 *
299 * @return string
300 * @api
301 */
302 public function getFax() {
303 return $this->fax;
304 }
305
306 /**
307 * Sets the email value
308 *
309 * @param string $email
310 * @return void
311 * @api
312 */
313 public function setEmail($email) {
314 $this->email = $email;
315 }
316
317 /**
318 * Returns the email value
319 *
320 * @return string
321 * @api
322 */
323 public function getEmail() {
324 return $this->email;
325 }
326
327 /**
328 * Sets the lockToDomain value
329 *
330 * @param string $lockToDomain
331 * @return void
332 * @api
333 */
334 public function setLockToDomain($lockToDomain) {
335 $this->lockToDomain = $lockToDomain;
336 }
337
338 /**
339 * Returns the lockToDomain value
340 *
341 * @return string
342 * @api
343 */
344 public function getLockToDomain() {
345 return $this->lockToDomain;
346 }
347
348 /**
349 * Sets the title value
350 *
351 * @param string $title
352 * @return void
353 * @api
354 */
355 public function setTitle($title) {
356 $this->title = $title;
357 }
358
359 /**
360 * Returns the title value
361 *
362 * @return string
363 * @api
364 */
365 public function getTitle() {
366 return $this->title;
367 }
368
369 /**
370 * Sets the zip value
371 *
372 * @param string $zip
373 * @return void
374 * @api
375 */
376 public function setZip($zip) {
377 $this->zip = $zip;
378 }
379
380 /**
381 * Returns the zip value
382 *
383 * @return string
384 * @api
385 */
386 public function getZip() {
387 return $this->zip;
388 }
389
390 /**
391 * Sets the city value
392 *
393 * @param string $city
394 * @return void
395 * @api
396 */
397 public function setCity($city) {
398 $this->city = $city;
399 }
400
401 /**
402 * Returns the city value
403 *
404 * @return string
405 * @api
406 */
407 public function getCity() {
408 return $this->city;
409 }
410
411 /**
412 * Sets the country value
413 *
414 * @param string $country
415 * @return void
416 * @api
417 */
418 public function setCountry($country) {
419 $this->country = $country;
420 }
421
422 /**
423 * Returns the country value
424 *
425 * @return string
426 * @api
427 */
428 public function getCountry() {
429 return $this->country;
430 }
431
432 /**
433 * Sets the www value
434 *
435 * @param string $www
436 * @return void
437 * @api
438 */
439 public function setWww($www) {
440 $this->www = $www;
441 }
442
443 /**
444 * Returns the www value
445 *
446 * @return string
447 * @api
448 */
449 public function getWww() {
450 return $this->www;
451 }
452
453 /**
454 * Sets the company value
455 *
456 * @param string $company
457 * @return void
458 * @api
459 */
460 public function setCompany($company) {
461 $this->company = $company;
462 }
463
464 /**
465 * Returns the company value
466 *
467 * @return string
468 * @api
469 */
470 public function getCompany() {
471 return $this->company;
472 }
473
474 /**
475 * Sets the image value
476 *
477 * @param string $image
478 * @return void
479 * @api
480 */
481 public function setImage($image) {
482 $this->image = $image;
483 }
484
485 /**
486 * Returns the image value
487 *
488 * @return string
489 * @api
490 */
491 public function getImage() {
492 return $this->image;
493 }
494
495 /**
496 * Sets the lastLogin value
497 *
498 * @param DateTime $lastLogin
499 * @return void
500 * @api
501 */
502 public function setLastLogin($lastLogin) {
503 $this->lastLogin = $lastLogin;
504 }
505
506 /**
507 * Returns the lastLogin value
508 *
509 * @return DateTime
510 * @api
511 */
512 public function getLastLogin() {
513 return $this->lastLogin;
514 }
515
516 /**
517 * Sets the isOnline value
518 *
519 * @param DateTime $isOnline
520 * @return void
521 * @api
522 */
523 public function setIsOnline($isOnline) {
524 $this->isOnline = $isOnline;
525 }
526
527 /**
528 * Returns the isOnline value
529 *
530 * @return DateTime
531 * @api
532 */
533 public function getIsOnline() {
534 return $this->isOnline;
535 }
536
537 }
538 ?>