1 | <?php |
||
15 | class Mapper implements SingletonInterface |
||
16 | { |
||
17 | /** |
||
18 | * Custom mapper. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $customMapper = []; |
||
23 | |||
24 | /** |
||
25 | * Internal mapper. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $internalMapper = [ |
||
30 | 'Boolean', |
||
31 | 'Float', |
||
32 | 'DateTime', |
||
33 | 'FileReference', |
||
34 | 'FileReferenceObjectStorage', |
||
35 | 'ObjectStorage', |
||
36 | 'Int', |
||
37 | 'String', |
||
38 | 'Model', |
||
39 | 'StaticInfoTables', |
||
40 | 'Array', |
||
41 | ]; |
||
42 | |||
43 | /** |
||
44 | * Get the TCA configuration for the current type. |
||
45 | * |
||
46 | * @param string $type |
||
47 | * @param string $fieldName |
||
48 | * @param bool $overWriteLabel |
||
49 | * |
||
50 | * @return array |
||
51 | */ |
||
52 | public function getTcaConfiguration($type, $fieldName, $overWriteLabel = false) |
||
63 | |||
64 | /** |
||
65 | * Get the database definition for the current mapper. |
||
66 | * |
||
67 | * @param string $type |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getDatabaseDefinition($type) |
||
77 | |||
78 | /** |
||
79 | * Add a custom mapper. |
||
80 | * |
||
81 | * @param string $className |
||
82 | */ |
||
83 | public function addCustomMapper($className): void |
||
87 | |||
88 | /** |
||
89 | * Get a valid mapper for the given type. |
||
90 | * |
||
91 | * @param string $type |
||
92 | * |
||
93 | * @throws \Exception |
||
94 | * |
||
95 | * @return MapperInterface |
||
96 | */ |
||
97 | protected function getMapperByType($type) |
||
109 | |||
110 | /** |
||
111 | * Get all mappers. |
||
112 | * |
||
113 | * @return array |
||
114 | */ |
||
115 | protected function getMappers() |
||
124 | |||
125 | /** |
||
126 | * Get internal mapper class names. |
||
127 | * |
||
128 | * @return array |
||
129 | */ |
||
130 | protected function getInternalMapperClasses() |
||
139 | } |
||
140 |