[+BUGFIX] Extbase (Domain): fixed (non-breaking) method name for getting usergroup...
[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 * @api
34 */
35 class Tx_Extbase_Domain_Model_FrontendUser extends Tx_Extbase_DomainObject_AbstractEntity {
36
37 /**
38 * @var string
39 */
40 protected $username;
41
42 /**
43 * @var string
44 */
45 protected $password;
46
47 /**
48 * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FrontendUserGroup>
49 */
50 protected $usergroup;
51
52 /**
53 * @var string
54 */
55 protected $name;
56
57 /**
58 * @var string
59 */
60 protected $firstName;
61
62 /**
63 * @var string
64 */
65 protected $middleName;
66
67 /**
68 * @var string
69 */
70 protected $lastName;
71
72 /**
73 * @var string
74 */
75 protected $address = '';
76
77 /**
78 * @var string
79 */
80 protected $telephone = '';
81
82 /**
83 * @var string
84 */
85 protected $fax = '';
86
87 /**
88 * @var string
89 */
90 protected $email = '';
91
92 /**
93 * @var string
94 */
95 protected $lockToDomain = '';
96
97 /**
98 * @var string
99 */
100 protected $title = '';
101
102 /**
103 * @var string
104 */
105 protected $zip = '';
106
107 /**
108 * @var string
109 */
110 protected $city = '';
111
112 /**
113 * @var string
114 */
115 protected $country = '';
116
117 /**
118 * @var string
119 */
120 protected $www = '';
121
122 /**
123 * @var string
124 */
125 protected $company = '';
126
127 /**
128 * @var string
129 */
130 protected $image = '';
131
132 /**
133 * @var DateTime
134 */
135 protected $lastlogin = '';
136
137 /**
138 * @var DateTime
139 */
140 protected $isOnline = '';
141
142 /**
143 * Constructs a new Front-End User
144 *
145 * @api
146 */
147 public function __construct($username = '', $password = '') {
148 $this->username = $username;
149 $this->password = $password;
150 $this->usergroup = new Tx_Extbase_Persistence_ObjectStorage();
151 }
152
153 /**
154 * Sets the username value
155 *
156 * @param string $username
157 * @return void
158 * @api
159 */
160 public function setUsername($username) {
161 $this->username = $username;
162 }
163
164 /**
165 * Returns the username value
166 *
167 * @return string
168 * @api
169 */
170 public function getUsername() {
171 return $this->username;
172 }
173
174 /**
175 * Sets the password value
176 *
177 * @param string $password
178 * @return void
179 * @api
180 */
181 public function setPassword($password) {
182 $this->password = $password;
183 }
184
185 /**
186 * Returns the password value
187 *
188 * @return string
189 * @api
190 */
191 public function getPassword() {
192 return $this->password;
193 }
194
195 /**
196 * Sets the usergroups. Keep in mind that the property is called "usergroup"
197 * although it can hold several usergroups.
198 *
199 * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FrontendUserGroup> $usergroup An object storage containing the usergroups to add
200 * @return void
201 * @api
202 */
203 public function setUsergroup(Tx_Extbase_Persistence_ObjectStorage $usergroup) {
204 $this->usergroup = $usergroup;
205 }
206
207 /**
208 * Adds a usergroup to the frontend user
209 *
210 * @param Tx_Extbase_Domain_Model_FrontendUserGroup $usergroup
211 * @return void
212 * @api
213 */
214 public function addUsergroup(Tx_Extbase_Domain_Model_FrontendUserGroup $usergroup) {
215 $this->usergroup->attach($usergroup);
216 }
217
218 /**
219 * Removes a usergroup from the frontend user
220 *
221 * @param Tx_Extbase_Domain_Model_FrontendUserGroup $usergroup
222 * @return void
223 * @api
224 */
225 public function removeUsergroup(Tx_Extbase_Domain_Model_FrontendUserGroup $usergroup) {
226 $this->usergroup->detach($usergroup);
227 }
228
229 /**
230 * Returns the usergroups. Keep in mind that the property is called "usergroup"
231 * although it can hold several usergroups.
232 *
233 * @return Tx_Extbase_Persistence_ObjectStorage An object storage containing the usergroup
234 * @api
235 * @deprecated since Extbase 1.3.0; will be removed in Extbase 1.5.0 - use Tx_Extbase_Domain_Model_FrontendUser::getUsergroup() instead
236 */
237 public function getUsergroups() {
238 t3lib_div::logDeprecatedFunction();
239 return $this->usergroup;
240 }
241
242 /**
243 * Returns the usergroups. Keep in mind that the property is called "usergroup"
244 * although it can hold several usergroups.
245 *
246 * @return Tx_Extbase_Persistence_ObjectStorage An object storage containing the usergroup
247 * @api
248 */
249 public function getUsergroup() {
250 return $this->usergroup;
251 }
252
253 /**
254 * Sets the name value
255 *
256 * @param string $name
257 * @return void
258 * @api
259 */
260 public function setName($name) {
261 $this->name = $name;
262 }
263
264 /**
265 * Returns the name value
266 *
267 * @return string
268 * @api
269 */
270 public function getName() {
271 return $this->name;
272 }
273
274 /**
275 * Sets the firstName value
276 *
277 * @param string $firstName
278 * @return void
279 * @api
280 */
281 public function setFirstName($firstName) {
282 $this->firstName = $firstName;
283 }
284
285 /**
286 * Returns the firstName value
287 *
288 * @return string
289 * @api
290 */
291 public function getFirstName() {
292 return $this->firstName;
293 }
294
295 /**
296 * Sets the middleName value
297 *
298 * @param string $middleName
299 * @return void
300 * @api
301 */
302 public function setMiddleName($middleName) {
303 $this->middleName = $middleName;
304 }
305
306 /**
307 * Returns the middleName value
308 *
309 * @return string
310 * @api
311 */
312 public function getMiddleName() {
313 return $this->middleName;
314 }
315
316 /**
317 * Sets the lastName value
318 *
319 * @param string $lastName
320 * @return void
321 * @api
322 */
323 public function setLastName($lastName) {
324 $this->lastName = $lastName;
325 }
326
327 /**
328 * Returns the lastName value
329 *
330 * @return string
331 * @api
332 */
333 public function getLastName() {
334 return $this->lastName;
335 }
336
337 /**
338 * Sets the address value
339 *
340 * @param string $address
341 * @return void
342 * @api
343 */
344 public function setAddress($address) {
345 $this->address = $address;
346 }
347
348 /**
349 * Returns the address value
350 *
351 * @return string
352 * @api
353 */
354 public function getAddress() {
355 return $this->address;
356 }
357
358 /**
359 * Sets the telephone value
360 *
361 * @param string $telephone
362 * @return void
363 * @api
364 */
365 public function setTelephone($telephone) {
366 $this->telephone = $telephone;
367 }
368
369 /**
370 * Returns the telephone value
371 *
372 * @return string
373 * @api
374 */
375 public function getTelephone() {
376 return $this->telephone;
377 }
378
379 /**
380 * Sets the fax value
381 *
382 * @param string $fax
383 * @return void
384 * @api
385 */
386 public function setFax($fax) {
387 $this->fax = $fax;
388 }
389
390 /**
391 * Returns the fax value
392 *
393 * @return string
394 * @api
395 */
396 public function getFax() {
397 return $this->fax;
398 }
399
400 /**
401 * Sets the email value
402 *
403 * @param string $email
404 * @return void
405 * @api
406 */
407 public function setEmail($email) {
408 $this->email = $email;
409 }
410
411 /**
412 * Returns the email value
413 *
414 * @return string
415 * @api
416 */
417 public function getEmail() {
418 return $this->email;
419 }
420
421 /**
422 * Sets the lockToDomain value
423 *
424 * @param string $lockToDomain
425 * @return void
426 * @api
427 */
428 public function setLockToDomain($lockToDomain) {
429 $this->lockToDomain = $lockToDomain;
430 }
431
432 /**
433 * Returns the lockToDomain value
434 *
435 * @return string
436 * @api
437 */
438 public function getLockToDomain() {
439 return $this->lockToDomain;
440 }
441
442 /**
443 * Sets the title value
444 *
445 * @param string $title
446 * @return void
447 * @api
448 */
449 public function setTitle($title) {
450 $this->title = $title;
451 }
452
453 /**
454 * Returns the title value
455 *
456 * @return string
457 * @api
458 */
459 public function getTitle() {
460 return $this->title;
461 }
462
463 /**
464 * Sets the zip value
465 *
466 * @param string $zip
467 * @return void
468 * @api
469 */
470 public function setZip($zip) {
471 $this->zip = $zip;
472 }
473
474 /**
475 * Returns the zip value
476 *
477 * @return string
478 * @api
479 */
480 public function getZip() {
481 return $this->zip;
482 }
483
484 /**
485 * Sets the city value
486 *
487 * @param string $city
488 * @return void
489 * @api
490 */
491 public function setCity($city) {
492 $this->city = $city;
493 }
494
495 /**
496 * Returns the city value
497 *
498 * @return string
499 * @api
500 */
501 public function getCity() {
502 return $this->city;
503 }
504
505 /**
506 * Sets the country value
507 *
508 * @param string $country
509 * @return void
510 * @api
511 */
512 public function setCountry($country) {
513 $this->country = $country;
514 }
515
516 /**
517 * Returns the country value
518 *
519 * @return string
520 * @api
521 */
522 public function getCountry() {
523 return $this->country;
524 }
525
526 /**
527 * Sets the www value
528 *
529 * @param string $www
530 * @return void
531 * @api
532 */
533 public function setWww($www) {
534 $this->www = $www;
535 }
536
537 /**
538 * Returns the www value
539 *
540 * @return string
541 * @api
542 */
543 public function getWww() {
544 return $this->www;
545 }
546
547 /**
548 * Sets the company value
549 *
550 * @param string $company
551 * @return void
552 * @api
553 */
554 public function setCompany($company) {
555 $this->company = $company;
556 }
557
558 /**
559 * Returns the company value
560 *
561 * @return string
562 * @api
563 */
564 public function getCompany() {
565 return $this->company;
566 }
567
568 /**
569 * Sets the image value
570 *
571 * @param string $image
572 * @return void
573 * @api
574 */
575 public function setImage($image) {
576 $this->image = $image;
577 }
578
579 /**
580 * Returns the image value
581 *
582 * @return string
583 * @api
584 */
585 public function getImage() {
586 return $this->image;
587 }
588
589 /**
590 * Sets the lastlogin value
591 *
592 * @param DateTime $lastlogin
593 * @return void
594 * @api
595 */
596 public function setLastlogin(DateTime $lastlogin) {
597 $this->lastlogin = $lastlogin;
598 }
599
600 /**
601 * Returns the lastlogin value
602 *
603 * @return DateTime
604 * @api
605 */
606 public function getLastlogin() {
607 return $this->lastlogin;
608 }
609
610 /**
611 * Sets the isOnline value
612 *
613 * @param DateTime $isOnline
614 * @return void
615 * @api
616 */
617 public function setIsOnline($isOnline) {
618 $this->isOnline = $isOnline;
619 }
620
621 /**
622 * Returns the isOnline value
623 *
624 * @return DateTime
625 * @api
626 */
627 public function getIsOnline() {
628 return $this->isOnline;
629 }
630
631 }
632 ?>