TYPO3 CMS  TYPO3_8-7
Person.php
Go to the documentation of this file.
1 <?php
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 
21 {
25  protected $firstname = '';
26 
30  protected $lastname = '';
31 
35  protected $email = '';
36 
40  protected $tags = null;
41 
45  protected $tagsSpecial = null;
46 
51  {
52  $this->setFirstname($firstname);
53  $this->setLastname($lastname);
54  $this->setEmail($email);
55 
56  $this->tags = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
57  $this->tagsSpecial = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
58  }
59 
65  public function setFirstname($firstname)
66  {
67  $this->firstname = $firstname;
68  }
69 
75  public function getFirstname()
76  {
77  return $this->firstname;
78  }
79 
85  public function setLastname($lastname)
86  {
87  $this->lastname = $lastname;
88  }
89 
95  public function getLastname()
96  {
97  return $this->lastname;
98  }
99 
105  public function getFullName()
106  {
107  return $this->firstname . ' ' . $this->lastname;
108  }
109 
115  public function setEmail($email)
116  {
117  $this->email = $email;
118  }
119 
125  public function getEmail()
126  {
127  return $this->email;
128  }
129 
133  public function getTags()
134  {
135  return $this->tags;
136  }
137 
141  public function setTags(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $tags)
142  {
143  $this->tags = $tags;
144  }
145 
149  public function addTag(Tag $tag)
150  {
151  $this->tags->attach($tag);
152  }
153 
157  public function removeTag(Tag $tag)
158  {
159  $this->tags->detach($tag);
160  }
161 
165  public function getTagsSpecial()
166  {
167  return $this->tagsSpecial;
168  }
169 
173  public function setTagsSpecial(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $tagsSpecial)
174  {
175  $this->tagsSpecial = $tagsSpecial;
176  }
177 
181  public function addTagSpecial(Tag $tag)
182  {
183  $this->tagsSpecial->attach($tag);
184  }
185 
189  public function removeTagSpecial(Tag $tag)
190  {
191  $this->tagsSpecial->detach($tag);
192  }
193 }
setTags(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $tags)
Definition: Person.php:141
__construct($firstname, $lastname, $email)
Definition: Person.php:50
setTagsSpecial(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $tagsSpecial)
Definition: Person.php:173