[TASK] Test rendering of translated select MM relations in Extbase
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Functional / Fixtures / Extensions / blog_example / Classes / Domain / Model / TtContent.php
1 <?php
2 declare(strict_types = 1);
3
4 namespace ExtbaseTeam\BlogExample\Domain\Model;
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
19 use TYPO3\CMS\Extbase\Annotation as Extbase;
20
21 /**
22 * A tt_content model
23 */
24 class TtContent extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
25 {
26 /**
27 * uid
28 *
29 * @var string
30 */
31 protected $uid = '';
32
33 /**
34 * pid
35 *
36 * @var string
37 */
38 protected $pid = '';
39
40 /**
41 * @var string
42 */
43 protected $header;
44
45 /**
46 * Images
47 *
48 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
49 * @Extbase\ORM\Lazy
50 */
51 protected $image;
52
53 /**
54 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category>
55 */
56 protected $categories;
57
58 /**
59 * Constructs this post
60 */
61 public function __construct()
62 {
63 $this->image = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
64 $this->categories = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
65 }
66
67 /**
68 * Gets the uid
69 *
70 * @return string $uid
71 */
72 public function getUid()
73 {
74 return $this->uid;
75 }
76
77 /**
78 * Gets the pid
79 *
80 * @return string $pid
81 */
82 public function getPid()
83 {
84 return $this->pid;
85 }
86
87 /**
88 * Returns the header
89 *
90 * @return string $header
91 */
92 public function getHeader()
93 {
94 return $this->header;
95 }
96
97 /**
98 * Sets the header
99 *
100 * @param string $header
101 */
102 public function setHeader($header)
103 {
104 $this->header = $header;
105 }
106
107 /**
108 * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
109 */
110 public function getImage(): \TYPO3\CMS\Extbase\Persistence\ObjectStorage
111 {
112 return $this->image;
113 }
114
115 /**
116 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $image
117 */
118 public function setImage(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $image)
119 {
120 $this->image = $image;
121 }
122
123 /**
124 * Add category to a CE
125 *
126 * @param \TYPO3\CMS\Extbase\Domain\Model\Category $category
127 */
128 public function addCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $category)
129 {
130 $this->categories->attach($category);
131 }
132
133 /**
134 * Set categories
135 *
136 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $categories
137 */
138 public function setCategories($categories)
139 {
140 $this->categories = $categories;
141 }
142
143 /**
144 * Get categories
145 *
146 * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
147 */
148 public function getCategories()
149 {
150 return $this->categories;
151 }
152
153 /**
154 * Remove category from a CE
155 *
156 * @param \TYPO3\CMS\Extbase\Domain\Model\Category $category
157 */
158 public function removeCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $category)
159 {
160 $this->categories->detach($category);
161 }
162
163 /**
164 * Returns this as a formatted string
165 *
166 * @return string
167 */
168 public function __toString()
169 {
170 return $this->getHeader();
171 }
172 }