‪TYPO3CMS  11.5
TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider:
TYPO3\CMS\Backend\Form\FormDataProvider\TcaCategory TYPO3\CMS\Backend\Form\FormDataProvider\TcaCheckboxItems TYPO3\CMS\Backend\Form\FormDataProvider\TcaLanguage TYPO3\CMS\Backend\Form\FormDataProvider\TcaRadioItems TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems

Public Member Functions

array translateLabels (array $result, array $itemArray, $table, $fieldName)
 
array addIconFromAltIcons (array $result, array $items, string $table, string $fieldName)
 
array sanitizeItemArray ($itemArray, $tableName, $fieldName)
 

Protected Member Functions

array resolveItemProcessorFunction (array $result, $fieldName, array $items)
 
array addItemsFromPageTsConfig (array $result, $fieldName, array $items)
 
array addItemsFromSpecial (array $result, $fieldName, array $items)
 
array addItemsFromFolder (array $result, $fieldName, array $items)
 
array addItemsFromForeignTable (array $result, $fieldName, array $items, bool $includeFullRows=false)
 
array removeItemsByKeepItemsPageTsConfig (array $result, $fieldName, array $items)
 
array removeItemsByRemoveItemsPageTsConfig (array $result, $fieldName, array $items)
 
array removeItemsByUserLanguageFieldRestriction (array $result, $fieldName, array $items)
 
array removeItemsByUserAuthMode (array $result, $fieldName, array $items)
 
array removeItemsByDoktypeUserRestriction (array $result, $fieldName, array $items)
 
array removeItemsByUserStorageRestriction (array $result, $fieldName, array $items)
 
 buildForeignTableQueryBuilder (array $result, string $localFieldName, bool $selectAllFields=false)
 
array processForeignTableClause (array $result, $foreignTableName, $localFieldName)
 
 parseSiteConfiguration (?SiteInterface $site, string $input)
 
 quoteParsedSiteConfiguration (Connection $connection, array $parsedSiteConfiguration)
 
 replaceParsedSiteConfiguration (string $input, array $parsedSiteConfiguration)
 
 parseStartingPointsFromSiteConfiguration (array $result, array $fieldConfig)
 
array processDatabaseFieldValue (array $row, $fieldName)
 
array processSelectFieldValue (array $result, $fieldName, array $staticValues)
 
int string getLiveUid (array $result)
 
LanguageService getLanguageService ()
 
BackendUserAuthentication getBackendUser ()
 

Detailed Description

Contains methods used by Data providers that handle elements with single items like select, radio and some more.

Definition at line 49 of file AbstractItemProvider.php.

Member Function Documentation

◆ addIconFromAltIcons()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::addIconFromAltIcons ( array  $result,
array  $items,
string  $table,
string  $fieldName 
)

Add alternative icon using "altIcons" TSconfig

Parameters
array$result
array$items
string$table
string$fieldName
Returns
‪array

Definition at line 1144 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaLanguage\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ addItemsFromFolder()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::addItemsFromFolder ( array  $result,
  $fieldName,
array  $items 
)
protected

TCA config "fileFolder" evaluation. Add them to $items

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array
Exceptions

Definition at line 248 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData().

◆ addItemsFromForeignTable()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::addItemsFromForeignTable ( array  $result,
  $fieldName,
array  $items,
bool  $includeFullRows = false 
)
protected

TCA config "foreign_table" evaluation. Add them to $items

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handled field name
array$items‪Incoming items
bool$includeFullRows

Hack for category tree to speed up tree processing, adding full db row as _row to item

Returns
‪array Modified item array
Exceptions

Definition at line 320 of file AbstractItemProvider.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaCategory\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ addItemsFromPageTsConfig()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::addItemsFromPageTsConfig ( array  $result,
  $fieldName,
array  $items 
)
protected

PageTsConfig addItems:

TCEFORMS.aTable.aField[.types][.aType].addItems.aValue = aLabel, with type specific options merged by pageTsConfig already

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 138 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaLanguage\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaCategory\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ addItemsFromSpecial()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::addItemsFromSpecial ( array  $result,
  $fieldName,
array  $items 
)
protected

TCA config "special" evaluation. Add them to $items

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array
Exceptions

Definition at line 176 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData().

◆ buildForeignTableQueryBuilder()

TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::buildForeignTableQueryBuilder ( array  $result,
string  $localFieldName,
bool  $selectAllFields = false 
)
protected

Build query to fetch foreign records. Helper method of addItemsFromForeignTable(), do not call otherwise.

Parameters
array$result‪Result array
string$localFieldName‪Current handle field name
bool$selectAllFields

True to select * all fields of row, otherwise an auto-calculated list. Select * is an optimization hack to speed up category tree calculation.

Definition at line 626 of file AbstractItemProvider.php.

References $GLOBALS, TYPO3\CMS\Core\Versioning\VersionState\MOVE_POINTER, TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_SHOW, TYPO3\CMS\Core\Database\Connection\PARAM_INT, TYPO3\CMS\Core\Database\Query\QueryHelper\parseOrderBy(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ getBackendUser()

BackendUserAuthentication TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::getBackendUser ( )
protected
Returns
‪BackendUserAuthentication

Definition at line 1215 of file AbstractItemProvider.php.

References $GLOBALS.

◆ getLanguageService()

◆ getLiveUid()

int string TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::getLiveUid ( array  $result)
protected

Gets the record uid of the live default record. If already pointing to the live record, the submitted record uid is returned.

Parameters
array$result‪Result array
Returns
‪int|string If the record is new, uid will be a string beginning with "NEW". Otherwise an int.
Exceptions

Definition at line 1193 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaCategory\processCategoryFieldValue().

◆ parseSiteConfiguration()

TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::parseSiteConfiguration ( ?SiteInterface  $site,
string  $input 
)
protected

Parse ###SITE:### placeholders in the input string and return the replacements array for later use in $this->replaceParsedSiteConfiguration().

IMPORTANT: If the values are used within raw SQL statements (e.g. foreign_table_where), consider using $this->quoteParsedSiteConfiguration() before replacement.

Definition at line 905 of file AbstractItemProvider.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\getValueByPath().

◆ parseStartingPointsFromSiteConfiguration()

TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::parseStartingPointsFromSiteConfiguration ( array  $result,
array  $fieldConfig 
)
protected

◆ processDatabaseFieldValue()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::processDatabaseFieldValue ( array  $row,
  $fieldName 
)
protected

Convert the current database values into an array

Parameters
array$row‪database row
string$fieldName‪fieldname to process
Returns
‪array

Definition at line 1010 of file AbstractItemProvider.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaCategory\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ processForeignTableClause()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::processForeignTableClause ( array  $result,
  $foreignTableName,
  $localFieldName 
)
protected

Replace markers in a where clause from TCA foreign_table_where

REC_FIELD_[field name]

THIS_UID### - is current element uid (zero if new).

CURRENT_PID### - is the current page id (pid of the record).

SITEROOT

PAGE_TSCONFIG_ID### - a value you can set from Page TSconfig dynamically.

PAGE_TSCONFIG_IDLIST### - a value you can set from Page TSconfig dynamically.

PAGE_TSCONFIG_STR### - a value you can set from Page TSconfig dynamically.

Parameters
array$result‪Result array
string$foreignTableName‪Name of foreign table
string$localFieldName‪Current handle field name
Returns
‪array Query parts with keys WHERE, ORDERBY, GROUPBY, LIMIT

Definition at line 746 of file AbstractItemProvider.php.

References TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), TYPO3\CMS\Core\Database\Query\QueryHelper\parseGroupBy(), TYPO3\CMS\Core\Database\Query\QueryHelper\parseOrderBy(), TYPO3\CMS\Core\Database\Query\QueryHelper\quoteDatabaseIdentifiers(), TYPO3\CMS\Core\Database\Query\QueryHelper\stripLogicalOperatorPrefix(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ processSelectFieldValue()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::processSelectFieldValue ( array  $result,
  $fieldName,
array  $staticValues 
)
protected

Validate and sanitize database row values of the select field with the given name. Creates an array out of databaseRow[selectField] values.

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪The current result array.
string$fieldName‪Name of the current select field.
array$staticValues‪Array with statically defined items, item value is used as array key.
Returns
‪array

Definition at line 1032 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ quoteParsedSiteConfiguration()

TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::quoteParsedSiteConfiguration ( Connection  $connection,
array  $parsedSiteConfiguration 
)
protected

Definition at line 936 of file AbstractItemProvider.php.

◆ removeItemsByDoktypeUserRestriction()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::removeItemsByDoktypeUserRestriction ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items if doktype is handled for non admin users

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 563 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ removeItemsByKeepItemsPageTsConfig()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::removeItemsByKeepItemsPageTsConfig ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items using "keepItems" pageTsConfig

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 436 of file AbstractItemProvider.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\keepItemsInArray().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaLanguage\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaCategory\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ removeItemsByRemoveItemsPageTsConfig()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::removeItemsByRemoveItemsPageTsConfig ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items using "removeItems" pageTsConfig

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 469 of file AbstractItemProvider.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaLanguage\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaCategory\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ removeItemsByUserAuthMode()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::removeItemsByUserAuthMode ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items by user restriction on authMode items

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 532 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ removeItemsByUserLanguageFieldRestriction()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::removeItemsByUserLanguageFieldRestriction ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items user restriction on language field

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 503 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ removeItemsByUserStorageRestriction()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::removeItemsByUserStorageRestriction ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items if sys_file_storage is not allowed for non-admin users.

Used by TcaSelectItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 593 of file AbstractItemProvider.php.

References TYPO3\CMS\Core\Resource\ResourceStorage\getUid().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData().

◆ replaceParsedSiteConfiguration()

TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::replaceParsedSiteConfiguration ( string  $input,
array  $parsedSiteConfiguration 
)
protected

Definition at line 964 of file AbstractItemProvider.php.

◆ resolveItemProcessorFunction()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::resolveItemProcessorFunction ( array  $result,
  $fieldName,
array  $items 
)
protected

Resolve "itemProcFunc" of elements.

Parameters
array$result‪Main result array
string$fieldName‪Field name to handle item list for
array$items‪Existing items array
Returns
‪array New list of item elements

Definition at line 59 of file AbstractItemProvider.php.

References TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR, and TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getLanguageService().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaCheckboxItems\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaRadioItems\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ sanitizeItemArray()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::sanitizeItemArray (   $itemArray,
  $tableName,
  $fieldName 
)

◆ translateLabels()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::translateLabels ( array  $result,
array  $itemArray,
  $table,
  $fieldName 
)

Translate the item labels

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
array$itemArray‪Items
string$table
string$fieldName
Returns
‪array

Definition at line 1097 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaLanguage\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().