BeforeFlexFormDataStructureIdentifierInitializedEvent implements StoppableEventInterface

FinalYes

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<string|int, mixed>
Returns the full TCA of the currently handled field, having `type=flex` set.
getIdentifier()  : array<string|int, mixed>|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<string|int, mixed>
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<string|int, mixed> $fieldTca, string $tableName, string $fieldName, array<string|int, mixed> $row) : mixed
Parameters
$fieldTca : array<string|int, mixed>

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<string|int, mixed>

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<string|int, mixed>
Return values
array<string|int, mixed>

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<string|int, mixed>|null
Return values
array<string|int, mixed>|null

getRow()

Returns the whole database row of the current record.

public getRow() : array<string|int, mixed>
Return values
array<string|int, mixed>

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<string|int, mixed> $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<string|int, mixed>

        
On this page

Search results