‪TYPO3CMS  11.5
Person.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
22 
27 {
31  protected ‪$firstname = '';
32 
36  protected ‪$lastname = '';
37 
41  protected ‪$email = '';
42 
46  protected ‪$tags;
47 
51  protected ‪$tagsSpecial;
52 
57  {
60  $this->‪setEmail(‪$email);
61 
62  $this->tags = new ‪ObjectStorage();
63  $this->tagsSpecial = new ‪ObjectStorage();
64  }
65 
71  public function ‪setFirstname(‪$firstname): void
72  {
73  $this->firstname = ‪$firstname;
74  }
75 
81  public function ‪getFirstname(): string
82  {
83  return ‪$this->firstname;
84  }
85 
91  public function ‪setLastname(‪$lastname): void
92  {
93  $this->lastname = ‪$lastname;
94  }
95 
101  public function ‪getLastname(): string
102  {
103  return ‪$this->lastname;
104  }
105 
111  public function ‪getFullName(): string
112  {
113  return $this->firstname . ' ' . ‪$this->lastname;
114  }
115 
121  public function ‪setEmail(‪$email): void
122  {
123  $this->email = ‪$email;
124  }
125 
131  public function ‪getEmail(): string
132  {
133  return ‪$this->email;
134  }
135 
139  public function ‪getTags()
140  {
141  return ‪$this->tags;
142  }
143 
147  public function ‪setTags(‪ObjectStorage ‪$tags): void
148  {
149  $this->tags = ‪$tags;
150  }
151 
155  public function ‪addTag(‪Tag $tag): void
156  {
157  $this->tags->attach($tag);
158  }
159 
163  public function ‪removeTag(‪Tag $tag): void
164  {
165  $this->tags->detach($tag);
166  }
167 
171  public function ‪getTagsSpecial()
172  {
173  return ‪$this->tagsSpecial;
174  }
175 
179  public function ‪setTagsSpecial(‪ObjectStorage ‪$tagsSpecial): void
180  {
181  $this->tagsSpecial = ‪$tagsSpecial;
182  }
183 
187  public function ‪addTagSpecial(‪Tag $tag): void
188  {
189  $this->tagsSpecial->attach($tag);
190  }
191 
195  public function ‪removeTagSpecial(‪Tag $tag): void
196  {
197  $this->tagsSpecial->detach($tag);
198  }
199 }
‪ExtbaseTeam\BlogExample\Domain\Model\Person\getFirstname
‪string getFirstname()
Definition: Person.php:76
‪ExtbaseTeam\BlogExample\Domain\Model\Person\$email
‪string $email
Definition: Person.php:38
‪ExtbaseTeam\BlogExample\Domain\Model\Person\setEmail
‪setEmail($email)
Definition: Person.php:116
‪ExtbaseTeam\BlogExample\Domain\Model\Person\getEmail
‪string getEmail()
Definition: Person.php:126
‪ExtbaseTeam\BlogExample\Domain\Model\Person\removeTagSpecial
‪removeTagSpecial(Tag $tag)
Definition: Person.php:190
‪ExtbaseTeam\BlogExample\Domain\Model\Person\$firstname
‪string $firstname
Definition: Person.php:30
‪ExtbaseTeam\BlogExample\Domain\Model\Person\getFullName
‪string getFullName()
Definition: Person.php:106
‪ExtbaseTeam\BlogExample\Domain\Model\Person\$tags
‪TYPO3 CMS Extbase Persistence ObjectStorage<\ExtbaseTeam\BlogExample\Domain\Model\Tag > $tags
Definition: Person.php:42
‪TYPO3\CMS\Extbase\DomainObject\AbstractEntity
Definition: AbstractEntity.php:22
‪ExtbaseTeam\BlogExample\Domain\Model\Person\addTag
‪addTag(Tag $tag)
Definition: Person.php:150
‪ExtbaseTeam\BlogExample\Domain\Model\Person\setFirstname
‪setFirstname($firstname)
Definition: Person.php:66
‪TYPO3\CMS\Extbase\Persistence\ObjectStorage
Definition: ObjectStorage.php:32
‪ExtbaseTeam\BlogExample\Domain\Model\Person\getTags
‪TYPO3 CMS Extbase Persistence ObjectStorage ExtbaseTeam BlogExample Domain Model Tag[] getTags()
Definition: Person.php:134
‪ExtbaseTeam\BlogExample\Domain\Model\Person\getTagsSpecial
‪TYPO3 CMS Extbase Persistence ObjectStorage ExtbaseTeam BlogExample Domain Model Tag[] getTagsSpecial()
Definition: Person.php:166
‪ExtbaseTeam\BlogExample\Domain\Model\Person\removeTag
‪removeTag(Tag $tag)
Definition: Person.php:158
‪ExtbaseTeam\BlogExample\Domain\Model\Person\setLastname
‪setLastname($lastname)
Definition: Person.php:86
‪ExtbaseTeam\BlogExample\Domain\Model\Person\__construct
‪__construct($firstname, $lastname, $email)
Definition: Person.php:51
‪ExtbaseTeam\BlogExample\Domain\Model\Person\$lastname
‪string $lastname
Definition: Person.php:34
‪ExtbaseTeam\BlogExample\Domain\Model\Person\setTagsSpecial
‪setTagsSpecial(ObjectStorage $tagsSpecial)
Definition: Person.php:174
‪ExtbaseTeam\BlogExample\Domain\Model\Person\addTagSpecial
‪addTagSpecial(Tag $tag)
Definition: Person.php:182
‪ExtbaseTeam\BlogExample\Domain\Model\Person\$tagsSpecial
‪TYPO3 CMS Extbase Persistence ObjectStorage<\ExtbaseTeam\BlogExample\Domain\Model\Tag > $tagsSpecial
Definition: Person.php:46
‪ExtbaseTeam\BlogExample\Domain\Model\Person
Definition: Person.php:27
‪ExtbaseTeam\BlogExample\Domain\Model\Person\setTags
‪setTags(ObjectStorage $tags)
Definition: Person.php:142
‪ExtbaseTeam\BlogExample\Domain\Model\Person\getLastname
‪string getLastname()
Definition: Person.php:96
‪ExtbaseTeam\BlogExample\Domain\Model
Definition: Administrator.php:18
‪ExtbaseTeam\BlogExample\Domain\Model\Tag
Definition: Tag.php:26