‪TYPO3CMS  ‪main
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 TYPO3\CMS\Backend\Form\FormDataProvider\TcaTablePermission

Public Member Functions

array translateLabels (array $result, array $itemArray, $table, $fieldName)
 
 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 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)
 
 getLanguageService ()
 
 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()

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

◆ 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 194 of file AbstractItemProvider.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), and TYPO3\CMS\Core\Utility\GeneralUtility\inList().

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 266 of file AbstractItemProvider.php.

References $GLOBALS, TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\buildForeignTableQueryBuilder(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getBackendUser(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getLanguageService(), and TYPO3\CMS\Frontend\Content\tryFrom.

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

Page TSconfig 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 147 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaLanguage\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaCategory\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\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 569 of file AbstractItemProvider.php.

References $GLOBALS, TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getBackendUser(), TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_SHOW, TYPO3\CMS\Core\Database\Connection\PARAM_INT, TYPO3\CMS\Core\Database\Query\QueryHelper\parseOrderBy(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\processForeignTableClause(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\addItemsFromForeignTable().

◆ getBackendUser()

◆ 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 1129 of file AbstractItemProvider.php.

References TYPO3\CMS\Webhooks\Message\$uid.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaCategory\processCategoryFieldValue(), and TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\processSelectFieldValue().

◆ 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 848 of file AbstractItemProvider.php.

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

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\parseStartingPointsFromSiteConfiguration(), and TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\processForeignTableClause().

◆ 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

◆ 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 693 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\Backend\Form\FormDataProvider\AbstractItemProvider\parseSiteConfiguration(), TYPO3\CMS\Core\Database\Query\QueryHelper\quoteDatabaseIdentifiers(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\quoteParsedSiteConfiguration(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\replaceParsedSiteConfiguration(), TYPO3\CMS\Core\Database\Query\QueryHelper\stripLogicalOperatorPrefix(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\buildForeignTableQueryBuilder().

◆ 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 975 of file AbstractItemProvider.php.

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

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

◆ 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 506 of file AbstractItemProvider.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getBackendUser(), and TYPO3\CMS\Core\Utility\GeneralUtility\inList().

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 381 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaLanguage\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\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 414 of file AbstractItemProvider.php.

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

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaLanguage\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\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 477 of file AbstractItemProvider.php.

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

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 448 of file AbstractItemProvider.php.

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

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 536 of file AbstractItemProvider.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getBackendUser(), and 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

◆ 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\Schema\Struct\SelectItem\fromTcaItemArray(), 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 1040 of file AbstractItemProvider.php.

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

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