TcaFlexPrepare implements FormDataProviderInterface

Resolve flex data structure and data values, prepare and normalize.

This is the first data provider in the chain of flex form related providers.

Table of Contents

Interfaces

FormDataProviderInterface
Interface must be implemented by form data provider classes.

Methods

addData()  : array<string|int, mixed>
Resolve flex data structures and prepare flex data values.
initializeDataStructure()  : array<string|int, mixed>
Fetch / initialize data structure.
initializeDataValues()  : array<string|int, mixed>
Parse / initialize value from xml string to array
migrateFlexformTcaDataStructureElements()  : array<string|int, mixed>
On-the-fly migration for flex form "TCA"
migrateFlexformTcaRecursive()  : array<string|int, mixed>
Recursively migrate flex form TCA
removeElementTceFormsRecursive()  : array<string|int, mixed>
Moves ['el']['something']['TCEforms'] to ['el']['something'] and ['ROOT']['TCEforms'] to ['ROOT'] recursive
removeTceFormsArrayKeyFromDataStructureElements()  : array<string|int, mixed>
Remove "TCEforms" key from all elements in data structure to simplify further parsing.

Methods

addData()

Resolve flex data structures and prepare flex data values.

public addData(array<string|int, mixed> $result) : array<string|int, mixed>

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

Parameters
$result : array<string|int, mixed>
Return values
array<string|int, mixed>

initializeDataStructure()

Fetch / initialize data structure.

protected initializeDataStructure(array<string|int, mixed> $result, string $fieldName) : array<string|int, mixed>

The sub array with different possible data structures in ['config']['ds'] is resolved here, ds array contains only the one resolved data structure after this method.

Parameters
$result : array<string|int, mixed>

Result array

$fieldName : string

Currently handled field name

Tags
throws
UnexpectedValueException
Return values
array<string|int, mixed>

Modified result

initializeDataValues()

Parse / initialize value from xml string to array

protected initializeDataValues(array<string|int, mixed> $result, string $fieldName) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>

Result array

$fieldName : string

Currently handled field name

Return values
array<string|int, mixed>

Modified result

migrateFlexformTcaDataStructureElements()

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

protected migrateFlexformTcaDataStructureElements(array<string|int, mixed> $result, string $fieldName) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>

Result array

$fieldName : string

Currently handled field name

Return values
array<string|int, mixed>

Modified result

migrateFlexformTcaRecursive()

Recursively migrate flex form TCA

protected migrateFlexformTcaRecursive(array<string|int, mixed> $structure, string $table, string $fieldName) : array<string|int, mixed>
Parameters
$structure : array<string|int, mixed>

Given hierarchy

$table : string
$fieldName : string
Return values
array<string|int, mixed>

Modified hierarchy

removeElementTceFormsRecursive()

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

protected removeElementTceFormsRecursive(array<string|int, mixed> $structure) : array<string|int, mixed>
Parameters
$structure : array<string|int, mixed>

Given hierarchy

Return values
array<string|int, mixed>

Modified hierarchy

removeTceFormsArrayKeyFromDataStructureElements()

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

protected removeTceFormsArrayKeyFromDataStructureElements(array<string|int, mixed> $result, string $fieldName) : array<string|int, mixed>

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

Parameters
$result : array<string|int, mixed>

Result array

$fieldName : string

Currently handled field name

Return values
array<string|int, mixed>

Modified result


        
On this page

Search results