TYPO3 CMS  TYPO3_8-7
TtContent.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
23 {
29  protected $uid = '';
30 
36  protected $pid = '';
37 
41  protected $header;
42 
49  protected $image;
50 
54  protected $categories;
55 
59  public function __construct()
60  {
61  $this->image = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
62  $this->categories = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
63  }
64 
70  public function getUid()
71  {
72  return $this->uid;
73  }
74 
80  public function getPid()
81  {
82  return $this->pid;
83  }
84 
90  public function getHeader()
91  {
92  return $this->header;
93  }
94 
100  public function setHeader($header)
101  {
102  $this->header = $header;
103  }
104 
108  public function getImage(): \TYPO3\CMS\Extbase\Persistence\ObjectStorage
109  {
110  return $this->image;
111  }
112 
116  public function setImage(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $image)
117  {
118  $this->image = $image;
119  }
120 
126  public function addCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $category)
127  {
128  $this->categories->attach($category);
129  }
130 
136  public function setCategories($categories)
137  {
138  $this->categories = $categories;
139  }
140 
146  public function getCategories()
147  {
148  return $this->categories;
149  }
150 
156  public function removeCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $category)
157  {
158  $this->categories->detach($category);
159  }
160 
166  public function __toString()
167  {
168  return $this->getHeader();
169  }
170 }
removeCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $category)
Definition: TtContent.php:156
setImage(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $image)
Definition: TtContent.php:116
addCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $category)
Definition: TtContent.php:126