60 public function compile(array $initialData)
65 $keysNotInResult = array_diff(array_keys($initialData), array_keys($result));
66 if (!empty($keysNotInResult)) {
67 throw new \InvalidArgumentException(
68 'Array keys ' . implode(
',', $keysNotInResult) .
' do not exist in result array and can not be set',
73 foreach ($initialData as $dataKey => $dataValue) {
74 if ($dataKey ===
'command') {
76 if ($dataValue !==
'edit' && $dataValue !==
'new') {
77 throw new \InvalidArgumentException(
'Command must be either "edit" or "new"', 1437653136);
80 if ($dataKey ===
'tableName') {
82 if (empty($dataValue)) {
83 throw new \InvalidArgumentException(
'No $tableName given', 1437654409);
86 if ($dataKey ===
'vanillaUid') {
88 throw new \InvalidArgumentException(
'$vanillaUid is not an integer or "NEW..." string ID', 1437654247);
90 if (isset($initialData[
'command']) && $initialData[
'command'] ===
'edit' && $dataValue < 0) {
91 throw new \InvalidArgumentException(
'Negative $vanillaUid is not supported with $command="edit', 1437654332);
94 $result[$dataKey] = $dataValue;
99 $resultKeysBeforeFormDataGroup = array_keys($result);
101 $result = $this->formDataGroup->compile($result);
103 if (!is_array($result)) {
104 throw new \UnexpectedValueException(
105 'Data group provider must return array',
110 if (!empty($result[
'renderData'])) {
111 throw new \RuntimeException(
112 'Array \'renderData\' not empty. Data providers must not add data here',
117 $resultKeysAfterFormDataGroup = array_keys($result);
119 if ($resultKeysAfterFormDataGroup !== $resultKeysBeforeFormDataGroup) {
120 throw new \UnexpectedValueException(
121 'Data group provider must not change result key list',
128 foreach ($this->removeKeysFromFinalResultArray as $key) {
129 unset($result[$key]);
160 'parentPageRow' =>
null,
163 'defaultLanguagePageRow' =>
null,
165 'neighborRow' =>
null,
180 'userPermissionOnPage' => 0,
182 'userTsConfig' => [],
187 'pageTsConfig' => [],
189 'vanillaParentPageTca' =>
null,
192 'systemLanguageRows' => [],
195 'pageLanguageOverlayRows' => [],
197 'defaultLanguageRow' =>
null,
200 'sourceLanguageRow' =>
null,
206 'defaultLanguageDiffRow' =>
null,
209 'additionalLanguageRows' => [],
211 'recordTypeValue' =>
'',
214 'processedTca' => [],
216 'columnsToProcess' => [],
218 'disabledWizards' =>
false,
223 'flexParentDatabaseRow' => [],
228 'flexSectionContainerPreparation' => [],
232 'selectTreeCompileItems' =>
false,
243 'inlineExpandCollapseStateArray' => [],
248 'inlineFirstPid' =>
null,
250 'inlineParentConfig' => [],
252 'isInlineChild' =>
false,
254 'isInlineChildExpanded' =>
false,
256 'isInlineAjaxOpeningContext' =>
false,
258 'inlineParentUid' =>
'',
260 'inlineParentTableName' =>
'',
262 'inlineParentFieldName' =>
'',
264 'inlineTopMostParentUid' =>
'',
266 'inlineTopMostParentTableName' =>
'',
268 'inlineTopMostParentFieldName' =>
'',
274 'isOnSymmetricSide' =>
false,
283 'inlineChildChildUid' =>
null,
287 'isInlineDefaultLanguageRecordInLocalizedParentContext' =>
false,
290 'inlineResolveExistingChildren' =>
true,
293 'inlineCompileExistingChildren' =>
true,
296 'elementBaseName' =>
'',
297 'tabAndInlineStack' => [],
299 'inlineStructure' => [],
303 'overrideValues' => [],
308 'defaultValues' => [],