BeforeFlexFormDataStructureIdentifierInitializedEvent

final class \TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent

Implements
StoppableEventInterface

Listeners to this event are able to specify the data structure identifier, used for a given TCA flex field.

Listeners should call ->setIdentifier() to set the identifier or ignore the event to allow other listeners to set it. Do not set an empty string as this will immediately stop event propagation!

The identifier SHOULD include the keys specified in the Identifier definition on FlexFormTools, and nothing else. Adding other keys may or may not work, depending on other code that is enabled, and they are not guaranteed nor covered by BC guarantees.

Warning: If adding source record details like the uid or pid here, this may turn out to be fragile. Be sure to test scenarios like workspaces and data handler copy/move well, additionally, this may break in between different core versions. It is probably a good idea to return at least something like [ 'type' => 'myExtension', ... ], see the core internal 'tca' and 'record' return values below

See the note on FlexFormTools regarding the schema of $dataStructure.

Table of Contents

Interfaces

StoppableEventInterface

Methods

__construct()  : mixed
getFieldName()  : string
getFieldTca()  : array
Returns the full TCA of the currently handled field, having `type=flex` set.
getIdentifier()  : array|null
Returns the current data structure identifier, which will always be `null` for listeners, since the event propagation is stopped as soon as a listener defines an identifier.
getRow()  : array
Returns the whole database row of the current record.
getTableName()  : string
isPropagationStopped()  : bool
setIdentifier()  : void
Allows to define the data structure identifier for the TCA field.

Methods

__construct()

public __construct(array $fieldTca, string $tableName, string $fieldName, array $row) : mixed

Parameters

$fieldTca : array

Full TCA of the field in question that has type=flex set

$tableName : string

The table name of the TCA field

$fieldName : string

The field name

$row : array

The data row

getFieldName()

public getFieldName() : string

Return values

string

getFieldTca()

Returns the full TCA of the currently handled field, having `type=flex` set.

public getFieldTca() : array

Return values

array

getIdentifier()

Returns the current data structure identifier, which will always be `null` for listeners, since the event propagation is stopped as soon as a listener defines an identifier.

public getIdentifier() : array|null

Return values

array|null

getRow()

Returns the whole database row of the current record.

public getRow() : array

Return values

array

getTableName()

public getTableName() : string

Return values

string

isPropagationStopped()

public isPropagationStopped() : bool

Return values

bool

setIdentifier()

Allows to define the data structure identifier for the TCA field.

public setIdentifier(array $identifier) : void

Setting an identifier will immediately stop propagation. Avoid setting this parameter to an empty array as this will also stop propagation.

Parameters

$identifier : array
On this page