‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent Class Reference
Inheritance diagram for TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent:

Public Member Functions

 __construct (private readonly array $fieldTca, private readonly string $tableName, private readonly string $fieldName, private readonly array $row,)
 
 getFieldTca ()
 
 getTableName ()
 
 getFieldName ()
 
 getRow ()
 
 setIdentifier (array $identifier)
 
 getIdentifier ()
 
 isPropagationStopped ()
 

Private Attributes

array $identifier = null
 

Detailed Description

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.

Definition at line 43 of file BeforeFlexFormDataStructureIdentifierInitializedEvent.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent::__construct ( private readonly array  $fieldTca,
private readonly string  $tableName,
private readonly string  $fieldName,
private readonly array  $row 
)
Parameters
array$fieldTca‪Full TCA of the field in question that has type=flex set
string$tableName‪The table name of the TCA field
string$fieldName‪The field name
array$row‪The data row

Definition at line 53 of file BeforeFlexFormDataStructureIdentifierInitializedEvent.php.

Member Function Documentation

◆ getFieldName()

TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent::getFieldName ( )

◆ getFieldTca()

TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent::getFieldTca ( )

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

Definition at line 64 of file BeforeFlexFormDataStructureIdentifierInitializedEvent.php.

◆ getIdentifier()

TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent::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.

Definition at line 103 of file BeforeFlexFormDataStructureIdentifierInitializedEvent.php.

◆ getRow()

TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent::getRow ( )

Returns the whole database row of the current record.

Definition at line 82 of file BeforeFlexFormDataStructureIdentifierInitializedEvent.php.

◆ getTableName()

TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent::getTableName ( )

◆ isPropagationStopped()

TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent::isPropagationStopped ( )

◆ setIdentifier()

TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent::setIdentifier ( array  $identifier)

Allows to define the data structure identifier for the TCA field. Setting an identifier will immediately stop propagation. Avoid setting this parameter to an empty array as this will also stop propagation.

Definition at line 93 of file BeforeFlexFormDataStructureIdentifierInitializedEvent.php.

References TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent\$identifier.

Referenced by TYPO3\CMS\Core\Tests\Functional\Configuration\FlexForm\FlexFormToolsTest\getDataStructureIdentifierWithListenerReturnsThatListenersValue().

Member Data Documentation

◆ $identifier

array TYPO3\CMS\Core\Configuration\Event\BeforeFlexFormDataStructureIdentifierInitializedEvent::$identifier = null
private