TcaTypesShowitem implements FormDataProviderInterface

Create final showitem configuration in processedTca for types and palette fields Handles all the nasty details like subtypes_addlist and friends.

Table of Contents

Interfaces

FormDataProviderInterface
Interface must be implemented by form data provider classes.

Properties

$processedTca  : array<string|int, mixed>
Processed TCA array

Methods

addData()  : array<string|int, mixed>
Set processedTca showitem
addFieldsBySubtypeAddList()  : array<string|int, mixed>
Insert additional fields in showitem based on subtypes_addlist
removeFields()  : array<string|int, mixed>
Remove fields from show item field list
removeFieldsByBitmaskExcludeBits()  : array<string|int, mixed>
Remove fields from showitem based on subtypes_excludelist
removeFieldsBySubtypeExcludeList()  : array<string|int, mixed>
Remove fields from showitem based on subtypes_excludelist
removeFieldsFromPalettes()  : array<string|int, mixed>
Remove a list of element from all palettes

Properties

$processedTca

Processed TCA array

protected array<string|int, mixed> $processedTca

Methods

addData()

Set processedTca showitem

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

Initialized result array

Return values
array<string|int, mixed>

addFieldsBySubtypeAddList()

Insert additional fields in showitem based on subtypes_addlist

protected addFieldsBySubtypeAddList(array<string|int, mixed> $result, string $subtypeFieldName, string $subtypeValue, string $recordTypeValue) : array<string|int, mixed>

databaseRow['theSubtypeValueField'] = 'theSubtypeValue' showitem = 'foo,theSubtypeValueField,bar' subtype_value_field = 'theSubtypeValueField' subtypes_addlist['theSubtypeValue'] = 'additionalField'

-> showitem = 'foo,theSubtypeValueField,additionalField,bar'

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

Result array

$subtypeFieldName : string

Field name holding subtype value

$subtypeValue : string

subtype value

$recordTypeValue : string

Given record type value

Return values
array<string|int, mixed>

Modified result array

removeFields()

Remove fields from show item field list

protected removeFields(array<string|int, mixed> $result, array<string|int, mixed> $removeListArray, string $recordTypeValue) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>

Given show item list

$removeListArray : array<string|int, mixed>

Fields to remove

$recordTypeValue : string

Given record type value

Return values
array<string|int, mixed>

Modified result array

removeFieldsByBitmaskExcludeBits()

Remove fields from showitem based on subtypes_excludelist

protected removeFieldsByBitmaskExcludeBits(array<string|int, mixed> $result, int $bitmaskValue, string $recordTypeValue) : array<string|int, mixed>

databaseRow['theSubtypeValueField'] = 5 // 1 0 1 showitem = 'foo,toRemoveBy4,bar' bitmask_value_field = 'theSubtypeValueField' bitmask_excludelist_bits[+2] = 'toRemoveBy4'

-> showitem = 'foo,bar'

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

Result array

$bitmaskValue : int

subtype value

$recordTypeValue : string

Given record type value

Return values
array<string|int, mixed>

Modified result array

removeFieldsBySubtypeExcludeList()

Remove fields from showitem based on subtypes_excludelist

protected removeFieldsBySubtypeExcludeList(array<string|int, mixed> $result, string $subtypeValue, string $recordTypeValue) : array<string|int, mixed>

databaseRow['theSubtypeValueField'] = 'theSubtypeValue' showitem = 'foo,toRemove,bar' subtype_value_field = 'theSubtypeValueField' subtypes_excludelist['theSubtypeValue'] = 'toRemove'

-> showitem = 'foo,bar'

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

Result array

$subtypeValue : string

subtype value

$recordTypeValue : string

Given record type value

Return values
array<string|int, mixed>

Modified result array

removeFieldsFromPalettes()

Remove a list of element from all palettes

protected removeFieldsFromPalettes(array<string|int, mixed> $result, array<string|int, mixed> $removeListArray) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>

Result array

$removeListArray : array<string|int, mixed>

Array of elements to remove

Tags
todo:

unit tests!

Return values
array<string|int, mixed>

Modified result array


        
On this page

Search results