[TASK] Streamline PHPDoc comment matches function/method signature
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Generic / Mapper / ColumnMap.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Persistence\Generic\Mapper;
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
17 /**
18 * A column map to map a column configured in $TCA on a property of a domain object.
19 */
20 class ColumnMap
21 {
22 /**
23 * Constants reflecting the type of relation
24 */
25 const RELATION_NONE = 'RELATION_NONE';
26 const RELATION_HAS_ONE = 'RELATION_HAS_ONE';
27 const RELATION_HAS_MANY = 'RELATION_HAS_MANY';
28 const RELATION_BELONGS_TO_MANY = 'RELATION_BELONGS_TO_MANY';
29 const RELATION_HAS_AND_BELONGS_TO_MANY = 'RELATION_HAS_AND_BELONGS_TO_MANY';
30
31 /**
32 * Constants reflecting how the relation information is stored
33 */
34 const RELATION_PARENT_FOREIGN_KEY = 'RELATION_PARENT_FOREIGN_KEY';
35 const RELATION_CHILD_FOREIGN_KEY = 'RELATION_CHILD_FOREIGN_KEY';
36 const RELATION_PARENT_CSV = 'RELATION_PARENT_CSV';
37 const RELATION_INTERMEDIATE_TABLE = 'RELATION_INTERMEDIATE_TABLE';
38
39 /**
40 * Constants reflecting the loading strategy
41 */
42 const STRATEGY_EAGER = 'eager';
43 const STRATEGY_LAZY_PROXY = 'proxy';
44 const STRATEGY_LAZY_STORAGE = 'storage';
45
46 /**
47 * The property name corresponding to the table name
48 *
49 * @var string
50 */
51 protected $propertyName;
52
53 /**
54 * The column name
55 *
56 * @var string
57 */
58 protected $columnName;
59
60 /**
61 * The type of relation
62 *
63 * @var string
64 */
65 protected $typeOfRelation;
66
67 /**
68 * The name of the child's class
69 *
70 * @var string
71 */
72 protected $childClassName;
73
74 /**
75 * The name of the child's table
76 *
77 * @var string
78 */
79 protected $childTableName;
80
81 /**
82 * The where clause to narrow down the selected child records
83 *
84 * @var string
85 */
86 protected $childTableWhereStatement;
87
88 /**
89 * The name of the field the results from the child's table are sorted by
90 *
91 * @var string
92 */
93 protected $childSortByFieldName;
94
95 /**
96 * The name of the relation table
97 *
98 * @var string
99 */
100 protected $relationTableName;
101
102 /**
103 * The name of the column of the relation table holding the page id
104 *
105 * @var string
106 */
107 protected $relationTablePageIdColumnName;
108
109 /**
110 * An array of field => value pairs to both insert and match against when writing/reading MM relations
111 *
112 * @var array
113 */
114 protected $relationTableMatchFields;
115
116 /**
117 * Array of field=>value pairs to insert when writing new MM relations
118 *
119 * @var array
120 */
121 protected $relationTableInsertFields;
122
123 /**
124 * The where clause to narrow down the selected relation table records
125 *
126 * @var string
127 */
128 protected $relationTableWhereStatement;
129
130 /**
131 * The name of the field holding the parents key
132 *
133 * @var string
134 */
135 protected $parentKeyFieldName;
136
137 /**
138 * The name of the field holding the name of the table of the parent's records
139 *
140 * @var string
141 */
142 protected $parentTableFieldName;
143
144 /**
145 * The name of the field holding the children key
146 *
147 * @var string
148 */
149 protected $childKeyFieldName;
150
151 /**
152 * Alternative format for storing DataTime formats
153 * (instead of using unix-time stamps). Allowed values
154 * are 'date', 'datetime' and 'time'
155 *
156 * @var string
157 */
158 protected $dateTimeStorageFormat;
159
160 /**
161 * @var \TYPO3\CMS\Core\DataHandling\TableColumnType
162 */
163 protected $type;
164
165 /**
166 * @var \TYPO3\CMS\Core\DataHandling\TableColumnSubType
167 */
168 protected $internalType;
169
170 /**
171 * Constructs a Column Map
172 *
173 * @param string $columnName The column name
174 * @param string $propertyName The property name
175 */
176 public function __construct($columnName, $propertyName)
177 {
178 // @todo Enable aliases (tx_anotherextension_addedcolumn -> theAddedColumn)
179 $this->setColumnName($columnName);
180 $this->setPropertyName($propertyName);
181 }
182
183 /**
184 * @param string $typeOfRelation
185 */
186 public function setTypeOfRelation($typeOfRelation)
187 {
188 $this->typeOfRelation = $typeOfRelation;
189 }
190
191 /**
192 * @return string
193 */
194 public function getTypeOfRelation()
195 {
196 return $this->typeOfRelation;
197 }
198
199 /**
200 * @param string $propertyName
201 */
202 public function setPropertyName($propertyName)
203 {
204 $this->propertyName = $propertyName;
205 }
206
207 /**
208 * @return string
209 */
210 public function getPropertyName()
211 {
212 return $this->propertyName;
213 }
214
215 /**
216 * @param string $columnName
217 */
218 public function setColumnName($columnName)
219 {
220 $this->columnName = $columnName;
221 }
222
223 /**
224 * @return string
225 */
226 public function getColumnName()
227 {
228 return $this->columnName;
229 }
230
231 /**
232 * @param string $childTableName
233 */
234 public function setChildTableName($childTableName)
235 {
236 $this->childTableName = $childTableName;
237 }
238
239 /**
240 * @return string
241 */
242 public function getChildTableName()
243 {
244 return $this->childTableName;
245 }
246
247 /**
248 * @param string $childTableWhereStatement
249 */
250 public function setChildTableWhereStatement($childTableWhereStatement)
251 {
252 $this->childTableWhereStatement = $childTableWhereStatement;
253 }
254
255 /**
256 * @return string
257 */
258 public function getChildTableWhereStatement()
259 {
260 return $this->childTableWhereStatement;
261 }
262
263 /**
264 * @param string $childSortByFieldName
265 */
266 public function setChildSortByFieldName($childSortByFieldName)
267 {
268 $this->childSortByFieldName = $childSortByFieldName;
269 }
270
271 /**
272 * @return string
273 */
274 public function getChildSortByFieldName()
275 {
276 return $this->childSortByFieldName;
277 }
278
279 /**
280 * @param string $relationTableName
281 */
282 public function setRelationTableName($relationTableName)
283 {
284 $this->relationTableName = $relationTableName;
285 }
286
287 /**
288 * @return string
289 */
290 public function getRelationTableName()
291 {
292 return $this->relationTableName;
293 }
294
295 /**
296 * @param string $relationTablePageIdColumnName
297 */
298 public function setRelationTablePageIdColumnName($relationTablePageIdColumnName)
299 {
300 $this->relationTablePageIdColumnName = $relationTablePageIdColumnName;
301 }
302
303 /**
304 * @return string
305 */
306 public function getRelationTablePageIdColumnName()
307 {
308 return $this->relationTablePageIdColumnName;
309 }
310
311 /**
312 * @param array $relationTableMatchFields
313 */
314 public function setRelationTableMatchFields(array $relationTableMatchFields)
315 {
316 $this->relationTableMatchFields = $relationTableMatchFields;
317 }
318
319 /**
320 * @return array
321 */
322 public function getRelationTableMatchFields()
323 {
324 return $this->relationTableMatchFields;
325 }
326
327 /**
328 * @param array $relationTableInsertFields
329 */
330 public function setRelationTableInsertFields(array $relationTableInsertFields)
331 {
332 $this->relationTableInsertFields = $relationTableInsertFields;
333 }
334
335 /**
336 * @return array
337 */
338 public function getRelationTableInsertFields()
339 {
340 return $this->relationTableInsertFields;
341 }
342
343 /**
344 * @param string $relationTableWhereStatement
345 */
346 public function setRelationTableWhereStatement($relationTableWhereStatement)
347 {
348 $this->relationTableWhereStatement = $relationTableWhereStatement;
349 }
350
351 /**
352 * @return string
353 */
354 public function getRelationTableWhereStatement()
355 {
356 return $this->relationTableWhereStatement;
357 }
358
359 /**
360 * @param string $parentKeyFieldName
361 */
362 public function setParentKeyFieldName($parentKeyFieldName)
363 {
364 $this->parentKeyFieldName = $parentKeyFieldName;
365 }
366
367 /**
368 * @return string
369 */
370 public function getParentKeyFieldName()
371 {
372 return $this->parentKeyFieldName;
373 }
374
375 /**
376 * @param string $parentTableFieldName
377 */
378 public function setParentTableFieldName($parentTableFieldName)
379 {
380 $this->parentTableFieldName = $parentTableFieldName;
381 }
382
383 /**
384 * @return string
385 */
386 public function getParentTableFieldName()
387 {
388 return $this->parentTableFieldName;
389 }
390
391 /**
392 * @param string $childKeyFieldName
393 */
394 public function setChildKeyFieldName($childKeyFieldName)
395 {
396 $this->childKeyFieldName = $childKeyFieldName;
397 }
398
399 /**
400 * @return string
401 */
402 public function getChildKeyFieldName()
403 {
404 return $this->childKeyFieldName;
405 }
406
407 /**
408 * @param string $dateTimeStorageFormat
409 */
410 public function setDateTimeStorageFormat($dateTimeStorageFormat)
411 {
412 $this->dateTimeStorageFormat = $dateTimeStorageFormat;
413 }
414
415 /**
416 * @return string
417 */
418 public function getDateTimeStorageFormat()
419 {
420 return $this->dateTimeStorageFormat;
421 }
422
423 /**
424 * @param \TYPO3\CMS\Core\DataHandling\TableColumnSubType $internalType
425 */
426 public function setInternalType($internalType)
427 {
428 $this->internalType = $internalType;
429 }
430
431 /**
432 * @return \TYPO3\CMS\Core\DataHandling\TableColumnSubType
433 */
434 public function getInternalType()
435 {
436 return $this->internalType;
437 }
438
439 /**
440 * @param \TYPO3\CMS\Core\DataHandling\TableColumnType $type
441 */
442 public function setType($type)
443 {
444 $this->type = $type;
445 }
446
447 /**
448 * @return \TYPO3\CMS\Core\DataHandling\TableColumnType
449 */
450 public function getType()
451 {
452 return $this->type;
453 }
454 }