‪TYPO3CMS  ‪main
TtContent.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 
24 
26 {
27  protected string ‪$header = '';
28 
34 
39 
40  public function ‪__construct()
41  {
42  $this->image = new ‪ObjectStorage();
43  $this->categories = new ‪ObjectStorage();
44  }
45 
46  public function ‪getHeader(): string
47  {
48  return ‪$this->header;
49  }
50 
51  public function ‪setHeader(string ‪$header): void
52  {
53  $this->header = ‪$header;
54  }
55 
59  public function ‪getImage(): ‪ObjectStorage
60  {
61  return ‪$this->image;
62  }
63 
67  public function ‪setImage(‪ObjectStorage ‪$image): void
68  {
69  $this->image = ‪$image;
70  }
71 
72  public function ‪addCategory(‪Category $category): void
73  {
74  $this->categories->attach($category);
75  }
76 
81  {
82  $this->categories = ‪$categories;
83  }
84 
89  {
90  return ‪$this->categories;
91  }
92 
93  public function ‪removeCategory(‪Category $category): void
94  {
95  $this->categories->detach($category);
96  }
97 
101  public function ‪__toString(): string
102  {
103  return $this->‪getHeader();
104  }
105 }
‪TYPO3Tests\BlogExample\Domain\Model\Category
Definition: Category.php:28
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:18
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\removeCategory
‪removeCategory(Category $category)
Definition: TtContent.php:93
‪TYPO3Tests\BlogExample\Domain\Model\TtContent
Definition: TtContent.php:26
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\getImage
‪ObjectStorage< FileReference > getImage()
Definition: TtContent.php:59
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\setCategories
‪setCategories(ObjectStorage $categories)
Definition: TtContent.php:80
‪TYPO3\CMS\Extbase\DomainObject\AbstractEntity
Definition: AbstractEntity.php:22
‪TYPO3\CMS\Extbase\Persistence\ObjectStorage
Definition: ObjectStorage.php:34
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\setHeader
‪setHeader(string $header)
Definition: TtContent.php:51
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\__construct
‪__construct()
Definition: TtContent.php:40
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\getCategories
‪ObjectStorage< Category > getCategories()
Definition: TtContent.php:88
‪TYPO3Tests\BlogExample\Domain\Model
Definition: Administrator.php:18
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\setImage
‪setImage(ObjectStorage $image)
Definition: TtContent.php:67
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\__toString
‪__toString()
Definition: TtContent.php:101
‪TYPO3\CMS\Extbase\Domain\Model\FileReference
Definition: FileReference.php:28
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\$header
‪string $header
Definition: TtContent.php:27
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\$image
‪ObjectStorage $image
Definition: TtContent.php:33
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\$categories
‪ObjectStorage $categories
Definition: TtContent.php:38
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\getHeader
‪getHeader()
Definition: TtContent.php:46
‪TYPO3Tests\BlogExample\Domain\Model\TtContent\addCategory
‪addCategory(Category $category)
Definition: TtContent.php:72