TYPO3  7.6
Public Member Functions | Protected Member Functions | List of all members
TcaFlexPrepare Class Reference
Inheritance diagram for TcaFlexPrepare:
FormDataProviderInterface

Public Member Functions

 addData (array $result)
 

Protected Member Functions

 createDefaultSheetInDataStructureIfNotGiven (array $result, $fieldName)
 
 removeTceFormsArrayKeyFromDataStructureElements (array $result, $fieldName)
 
 removeElementTceFormsRecursive (array $structure)
 
 migrateFlexformTcaDataStructureElements (array $result, $fieldName)
 
 migrateFlexformTcaRecursive ($structure, $table, $fieldName)
 

Detailed Description

Prepare flex data structure and data values.

This data provider is typically executed directly after TcaFlexFetch

Definition at line 26 of file TcaFlexPrepare.php.

Member Function Documentation

addData ( array  $result)

Resolve flex data structures and prepare flex data values.

Normalize some details to have aligned array nesting for the rest of the processing method and the render engine.

Parameters
array$result
Returns
array

Implements FormDataProviderInterface.

Definition at line 37 of file TcaFlexPrepare.php.

References TcaFlexPrepare\createDefaultSheetInDataStructureIfNotGiven(), TcaFlexPrepare\migrateFlexformTcaDataStructureElements(), and TcaFlexPrepare\removeTceFormsArrayKeyFromDataStructureElements().

createDefaultSheetInDataStructureIfNotGiven ( array  $result,
  $fieldName 
)
protected

Add a sheet structure if data structure has none yet to simplify further handling.

Example TCA field config: ['config']['ds']['ROOT'] becomes ['config']['ds']['sheets']['sDEF']['ROOT']

Parameters
array$resultResult array
string$fieldNameCurrently handled field name
Returns
array Modified result
Exceptions
\UnexpectedValueException

Definition at line 63 of file TcaFlexPrepare.php.

Referenced by TcaFlexPrepare\addData().

migrateFlexformTcaDataStructureElements ( array  $result,
  $fieldName 
)
protected

On-the-fly migration for flex form "TCA"

Parameters
array$resultResult array
string$fieldNameCurrently handled field name
Returns
array Modified result

Definition at line 139 of file TcaFlexPrepare.php.

References TcaFlexPrepare\migrateFlexformTcaRecursive().

Referenced by TcaFlexPrepare\addData().

migrateFlexformTcaRecursive (   $structure,
  $table,
  $fieldName 
)
protected

Recursively migrate flex form TCA

Parameters
array$structureGiven hierarchy
string$table
string$fieldName
Returns
array Modified hierarchy

Definition at line 155 of file TcaFlexPrepare.php.

References GeneralUtility\deprecationLog(), and GeneralUtility\makeInstance().

Referenced by TcaFlexPrepare\migrateFlexformTcaDataStructureElements().

removeElementTceFormsRecursive ( array  $structure)
protected

Moves ['el']['something']['TCEforms'] to ['el']['something'] and ['ROOT']['TCEforms'] to ['ROOT'] recursive

Parameters
array$structureGiven hierarchy
Returns
array Modified hierarchy

Definition at line 105 of file TcaFlexPrepare.php.

Referenced by TcaFlexPrepare\removeTceFormsArrayKeyFromDataStructureElements().

removeTceFormsArrayKeyFromDataStructureElements ( array  $result,
  $fieldName 
)
protected

Remove "TCEforms" key from all elements in data structure to simplify further parsing.

Example config: ['config']['ds']['sheets']['sDEF']['ROOT']['el']['anElement']['TCEforms']['label'] becomes ['config']['ds']['sheets']['sDEF']['ROOT']['el']['anElement']['label']

Parameters
array$resultResult array
string$fieldNameCurrently handled field name
Returns
array Modified result

Definition at line 91 of file TcaFlexPrepare.php.

References TcaFlexPrepare\removeElementTceFormsRecursive().

Referenced by TcaFlexPrepare\addData().