2 namespace TYPO3\CMS\Backend\Form;
58 public function compile(array $initialData)
63 $keysNotInResult = array_diff(array_keys($initialData), array_keys($result));
64 if (!empty($keysNotInResult)) {
65 throw new \InvalidArgumentException(
66 'Array keys ' . implode(
',', $keysNotInResult) .
' do not exist in result array and can not be set',
71 foreach ($initialData as $dataKey => $dataValue) {
72 if ($dataKey ===
'command') {
74 if ($dataValue !==
'edit' && $dataValue !==
'new') {
75 throw new \InvalidArgumentException(
'Command must be either "edit" or "new"', 1437653136);
78 if ($dataKey ===
'tableName') {
80 if (empty($dataValue)) {
81 throw new \InvalidArgumentException(
'No $tableName given', 1437654409);
84 if ($dataKey ===
'vanillaUid') {
85 if (!is_int($dataValue)) {
86 throw new \InvalidArgumentException(
'$vanillaUid is not an integer', 1437654247);
88 if (isset($initialData[
'command']) && $initialData[
'command'] ===
'edit' && $dataValue < 0) {
89 throw new \InvalidArgumentException(
'Negative $vanillaUid is not supported with $command="edit', 1437654332);
92 $result[$dataKey] = $dataValue;
97 $resultKeysBeforeFormDataGroup = array_keys($result);
99 $result = $this->formDataGroup->compile($result);
101 if (!is_array($result)) {
102 throw new \UnexpectedValueException(
103 'Data group provider must return array',
108 $resultKeysAfterFormDataGroup = array_keys($result);
110 if ($resultKeysAfterFormDataGroup !== $resultKeysBeforeFormDataGroup) {
111 throw new \UnexpectedValueException(
112 'Data group provider must not change result key list',
119 foreach ($this->removeKeysFromFinalResultArray as $key) {
120 unset($result[$key]);
150 'parentPageRow' => null,
152 'neighborRow' => null,
165 'userPermissionOnPage' => 0,
167 'userTsConfig' => [],
172 'pageTsConfig' => [],
174 'vanillaParentPageTca' => null,
177 'systemLanguageRows' => [],
180 'pageLanguageOverlayRows' => [],
182 'defaultLanguageRow' => null,
188 'defaultLanguageDiffRow' => null,
191 'additionalLanguageRows' => [],
193 'recordTypeValue' =>
'0',
196 'processedTca' => [],
198 'columnsToProcess' => [],
200 'disabledWizards' =>
false,
205 'flexParentDatabaseRow' => [],
216 'inlineExpandCollapseStateArray' => [],
220 'inlineFirstPid' => null,
222 'inlineParentConfig' => [],
224 'isInlineChild' =>
false,
226 'isInlineChildExpanded' =>
false,
228 'isInlineAjaxOpeningContext' =>
false,
230 'inlineParentUid' =>
'',
232 'inlineParentTableName' =>
'',
234 'inlineParentFieldName' =>
'',
236 'inlineTopMostParentUid' =>
'',
238 'inlineTopMostParentTableName' =>
'',
240 'inlineTopMostParentFieldName' =>
'',
246 'isOnSymmetricSide' =>
false,
255 'inlineChildChildUid' => null,
259 'isInlineDefaultLanguageRecordInLocalizedParentContext' =>
false,
262 'inlineResolveExistingChildren' =>
true,
265 'inlineCompileExistingChildren' =>
true,
268 'elementBaseName' =>
'',
269 'flexFormFieldIdentifierPrefix' =>
'ID',
270 'tabAndInlineStack' => [],
272 'inlineStructure' => [],
275 'overrideValues' => [],