‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\RecordList\DownloadRecordList Class Reference

Public Member Functions

 __construct (DatabaseRecordList $recordList, TranslationConfigurationProvider $translationConfigurationProvider)
 
array getHeaderRow (array $columnsToRender)
 
array[] getRecords (string $table, array $columnsToRender, BackendUserAuthentication $backendUser, bool $hideTranslations=false, bool $rawValues=false)
 

Protected Member Functions

array prepareRow (string $table, array $row, array $columnsToRender, int $pageId, bool $rawValues)
 

Protected Attributes

DatabaseRecordList $recordList
 
TranslationConfigurationProvider $translationConfigurationProvider
 

Detailed Description

Fetches all records like in the list module but returns them as array in order to allow downloads (e.g. CSV) in the Controller with prepared data.

This class acts as a composition-based wrapper for DatabaseRecordList for creating records ready to be downloaded.

this class is not part of the TYPO3 Core API due to its nature as being a wrapper for DatabaseRecordList and a very specific implementation.

Definition at line 34 of file DownloadRecordList.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\RecordList\DownloadRecordList::__construct ( DatabaseRecordList  $recordList,
TranslationConfigurationProvider  $translationConfigurationProvider 
)

Member Function Documentation

◆ getHeaderRow()

array TYPO3\CMS\Backend\RecordList\DownloadRecordList::getHeaderRow ( array  $columnsToRender)

Add header line with field names.

Parameters
string[]$columnsToRender
Returns
‪array the columns to be used / shown.

Definition at line 51 of file DownloadRecordList.php.

References $GLOBALS.

◆ getRecords()

array [] TYPO3\CMS\Backend\RecordList\DownloadRecordList::getRecords ( string  $table,
array  $columnsToRender,
BackendUserAuthentication  $backendUser,
bool  $hideTranslations = false,
bool  $rawValues = false 
)

Fetches records including translations (if not hidden) from the database in the specified order given by DatabaseRecordList and returns the prepared records ready to be rendered.

Parameters
string$table‪the TCA table
string[]$columnsToRender
BackendUserAuthentication$backendUser‪the current backend user needed to check for permissions
bool$rawValues‪Whether the field values should not be processed
Returns
‪array[] an array of rows ready to be output

Definition at line 76 of file DownloadRecordList.php.

References $GLOBALS, TYPO3\CMS\Core\Authentication\BackendUserAuthentication\checkLanguageAccess(), and TYPO3\CMS\Backend\RecordList\DownloadRecordList\prepareRow().

◆ prepareRow()

array TYPO3\CMS\Backend\RecordList\DownloadRecordList::prepareRow ( string  $table,
array  $row,
array  $columnsToRender,
int  $pageId,
bool  $rawValues 
)
protected

Prepares a DB row to process the values and maps the values to the columns to render to have the same output.

Parameters
string$table‪Table name
mixed[]$row‪Current record
string[]$columnsToRender‪the columns to be displayed / downloaded
int$pageId‪used for the legacy hook
bool$rawValues‪Whether the field values should not be processed
Returns
‪array the prepared row

Definition at line 130 of file DownloadRecordList.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\RecordList\DownloadRecordList\getRecords().

Member Data Documentation

◆ $recordList

DatabaseRecordList TYPO3\CMS\Backend\RecordList\DownloadRecordList::$recordList
protected

◆ $translationConfigurationProvider

TranslationConfigurationProvider TYPO3\CMS\Backend\RecordList\DownloadRecordList::$translationConfigurationProvider
protected