‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent Class Reference

Public Member Functions

 __construct (private array $columns, private readonly string $table, private readonly array $recordIds, private readonly DatabaseRecordList $recordList)
 setColumn (string $column, string $columnName='')
 hasColumn (string $columnName)
string null getColumn (string $columnName)
bool removeColumn (string $columnName)
 setColumns (array $columns)
 getColumns ()
 setHeaderAttributes (array $headerAttributes)
 getHeaderAttributes ()
 getTable ()
 getRecordIds ()
 getRecordList ()

Private Attributes

array $headerAttributes = []

Detailed Description

An event to modify the header columns for a table in the RecordList

Definition at line 25 of file ModifyRecordListHeaderColumnsEvent.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::__construct ( private array  $columns,
private readonly string  $table,
private readonly array  $recordIds,
private readonly DatabaseRecordList  $recordList 

Definition at line 37 of file ModifyRecordListHeaderColumnsEvent.php.

Member Function Documentation

◆ getColumn()

string null TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::getColumn ( string  $columnName)

Get column by its name

‪string|null The column or NULL if the column does not exist

Definition at line 77 of file ModifyRecordListHeaderColumnsEvent.php.

◆ getColumns()

TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::getColumns ( )

Definition at line 102 of file ModifyRecordListHeaderColumnsEvent.php.

◆ getHeaderAttributes()

TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::getHeaderAttributes ( )

◆ getRecordIds()

TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::getRecordIds ( )

Definition at line 122 of file ModifyRecordListHeaderColumnsEvent.php.

◆ getRecordList()

TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::getRecordList ( )

Returns the current DatabaseRecordList instance.

‪Might be replaced by a DTO in the future

Definition at line 132 of file ModifyRecordListHeaderColumnsEvent.php.

◆ getTable()

TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::getTable ( )

Definition at line 117 of file ModifyRecordListHeaderColumnsEvent.php.

◆ hasColumn()

TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::hasColumn ( string  $columnName)

Whether the column exists

Definition at line 67 of file ModifyRecordListHeaderColumnsEvent.php.

◆ removeColumn()

bool TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::removeColumn ( string  $columnName)

Remove column by its name

‪bool Whether the column could be removed - Will therefore return FALSE if the column to remove does not exist.

Definition at line 88 of file ModifyRecordListHeaderColumnsEvent.php.

◆ setColumn()

TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::setColumn ( string  $column,
string  $columnName = '' 

Add a new column or override an existing one. Latter is only possible, in case $columnName is given. Otherwise, the column will be added with a numeric index, which is generally not recommended.

Note: Due to the behaviour of DatabaseRecordList, just adding a column does not mean that it is also displayed. The internal $fieldArray needs to be adjusted as well. This method only adds the column to the data array. Therefore, this method should mainly be used to edit existing columns, e.g. change their label.

Definition at line 55 of file ModifyRecordListHeaderColumnsEvent.php.

◆ setColumns()

TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::setColumns ( array  $columns)

Definition at line 97 of file ModifyRecordListHeaderColumnsEvent.php.

◆ setHeaderAttributes()

TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::setHeaderAttributes ( array  $headerAttributes)

Member Data Documentation

◆ $headerAttributes

array TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent::$headerAttributes = []