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