‪TYPO3CMS  10.4
TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems:
TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider TYPO3\CMS\Backend\Form\FormDataProviderInterface

Public Member Functions

array addData (array $result)
 
array addInvalidItemsFromDatabase (array $result, $table, $fieldName, array $fieldConf, array $databaseValues, array $removedItems)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider
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

bool isTargetRenderType (array $fieldConfig)
 
array groupAndSortItems (array $allItems, array $definedGroups, array $sortOrders)
 
array sortItems (array $items, array $sortOrders)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider
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)
 
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)
 
array getExcludeFields ()
 
array getRegisteredFlexForms ($table)
 
array getExplicitAuthFieldValues ()
 
QueryBuilder buildForeignTableQueryBuilder (array $result, string $localFieldName)
 
array processForeignTableClause (array $result, $foreignTableName, $localFieldName)
 
array processDatabaseFieldValue (array $row, $fieldName)
 
array processSelectFieldValue (array $result, $fieldName, array $staticValues)
 
int getLiveUid (array $result)
 
 getAllSites ()
 
LanguageService getLanguageService ()
 
BackendUserAuthentication getBackendUser ()
 

Detailed Description

Resolve select items, set processed item list in processedTca, sanitize and resolve database field

Definition at line 25 of file TcaSelectItems.php.

Member Function Documentation

◆ addData()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::addData ( array  $result)

Resolve select items

Parameters
array$result
Returns
‪array
Exceptions

Implements TYPO3\CMS\Backend\Form\FormDataProviderInterface.

Definition at line 34 of file TcaSelectItems.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\addIconFromAltIcons(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addInvalidItemsFromDatabase(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\addItemsFromFolder(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\addItemsFromForeignTable(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\addItemsFromPageTsConfig(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\addItemsFromSpecial(), TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\groupAndSortItems(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\isTargetRenderType(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\processDatabaseFieldValue(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\processSelectFieldValue(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\removeItemsByDoktypeUserRestriction(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\removeItemsByKeepItemsPageTsConfig(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\removeItemsByRemoveItemsPageTsConfig(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\removeItemsByUserAuthMode(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\removeItemsByUserLanguageFieldRestriction(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\removeItemsByUserStorageRestriction(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\resolveItemProcessorFunction(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\sanitizeItemArray(), and TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\translateLabels().

◆ addInvalidItemsFromDatabase()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::addInvalidItemsFromDatabase ( array  $result,
  $table,
  $fieldName,
array  $fieldConf,
array  $databaseValues,
array  $removedItems 
)

Add values that are currently listed in the database columns but not in the selectable items list back to the list.

Parameters
array$result‪The current result array.
string$table‪The current table name
string$fieldName‪The current field name
array$fieldConf‪The configuration of the current field.
array$databaseValues‪The item values from the database, can contain invalid items!
array$removedItems‪Items removed by access checks and restrictions, must not be added as invalid values
Returns
‪array

Definition at line 144 of file TcaSelectItems.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getLanguageService().

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

◆ groupAndSortItems()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::groupAndSortItems ( array  $allItems,
array  $definedGroups,
array  $sortOrders 
)
protected

Is used when –div– elements in the item list are used, or if groups are defined via "groupItems" config array.

This method takes the –div– elements out of the list, and adds them to the group lists.

A main "none" group is added, which is always on top, when items are not set to be in a group. All items without a groupId - which is defined by the fourth key of an item in the item array - are added to the "none" group, or to the last group used previously, to ensure ordering as much as possible as before.

Then the found groups are iterated over the order in the [itemGroups] list, and items within a group can be sorted via "sortOrders" configuration.

All grouped items are then "flattened" out and –div– items are added for each group to keep backwards-compatibility.

Parameters
array$allItems‪all resolved items including the ones from foreign_table values. The group ID information can be found in fourth key [3] of an item.
array$definedGroups‪[config][itemGroups]
array$sortOrders‪[config][sortOrders]
Returns
‪array

Definition at line 209 of file TcaSelectItems.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getLanguageService(), TYPO3\CMS\Core\Localization\LanguageService\sL(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\sortItems().

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

◆ isTargetRenderType()

bool TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::isTargetRenderType ( array  $fieldConfig)
protected

Determines whether the current field is a valid target for this DataProvider

Parameters
array$fieldConfig
Returns
‪bool

Definition at line 185 of file TcaSelectItems.php.

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

◆ sortItems()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::sortItems ( array  $items,
array  $sortOrders 
)
protected

Sort given items by label or value or a custom user function built like "MyVendor\MyExtension\TcaSorter->sortItems" or a callable.

Parameters
array$items
array$sortOrders‪should be something like like [label => desc]
Returns
‪array the sorted items

Definition at line 288 of file TcaSelectItems.php.

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