TYPO3  7.6
Public Member Functions | Protected Member Functions | List of all members
AbstractItemProvider Class Reference
Inheritance diagram for AbstractItemProvider:
TcaCheckboxItems TcaRadioItems TcaSelectItems TcaSelectTreeItems

Public Member Functions

 translateLabels (array $result, array $itemArray, $table, $fieldName)
 
 sanitizeItemArray ($itemArray, $tableName, $fieldName)
 
 sanitizeMaxItems ($maxItems)
 
 getStaticValues ($itemArray, $dynamicItemArray)
 

Protected Member Functions

 addItemsFromPageTsConfig (array $result, $fieldName, array $items)
 
 addItemsFromSpecial (array $result, $fieldName, array $items)
 
 addItemsFromFolder (array $result, $fieldName, array $items)
 
 removeItemsByKeepItemsPageTsConfig (array $result, $fieldName, array $items)
 
 removeItemsByRemoveItemsPageTsConfig (array $result, $fieldName, array $items)
 
 removeItemsByUserLanguageFieldRestriction (array $result, $fieldName, array $items)
 
 removeItemsByUserAuthMode (array $result, $fieldName, array $items)
 
 removeItemsByDoktypeUserRestriction (array $result, $fieldName, array $items)
 
 getExcludeFields ()
 
 getRegisteredFlexForms ($table)
 
 getExplicitAuthFieldValues ()
 
 buildForeignTableQuery (array $result, $localFieldName)
 
 processForeignTableClause (array $result, $foreignTableName, $localFieldName)
 
 processDatabaseFieldValue (array $row, $fieldName)
 
 getLiveUid (array $result)
 
 getLanguageService ()
 
 getDatabaseConnection ()
 
 getBackendUser ()
 

Detailed Description

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

Definition at line 36 of file AbstractItemProvider.php.

Member Function Documentation

addItemsFromFolder ( array  $result,
  $fieldName,
array  $items 
)
protected

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

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$resultResult array
string$fieldNameCurrent handle field name
array$itemsIncoming items
Returns
array Modified item array

Definition at line 356 of file AbstractItemProvider.php.

References $GLOBALS, MathUtility\forceIntegerInRange(), GeneralUtility\getAllFilesAndFoldersInPath(), GeneralUtility\getFileAbsFileName(), GeneralUtility\inList(), GeneralUtility\removePrefixPathFromList(), and PathUtility\stripPathSitePrefix().

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().

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$resultresult array
string$fieldNameCurrent handle field name
array$itemsIncoming items
Returns
array Modified item array

Definition at line 112 of file AbstractItemProvider.php.

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().

addItemsFromSpecial ( array  $result,
  $fieldName,
array  $items 
)
protected

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

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$resultResult array
string$fieldNameCurrent handle field name
array$itemsIncoming items
Returns
array Modified item array
Exceptions
\UnexpectedValueException

Definition at line 149 of file AbstractItemProvider.php.

References $GLOBALS, AbstractItemProvider\getExcludeFields(), AbstractItemProvider\getExplicitAuthFieldValues(), AbstractItemProvider\getLanguageService(), GeneralUtility\makeInstance(), and PathUtility\stripPathSitePrefix().

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().

buildForeignTableQuery ( array  $result,
  $localFieldName 
)
protected

Build query to fetch foreign records

Parameters
array$resultResult array
string$localFieldNameCurrent handle field name
Returns
array Query array ready to be executed via Database->exec_SELECT_queryArray()
Exceptions
\UnexpectedValueException

Definition at line 888 of file AbstractItemProvider.php.

References $GLOBALS, BackendUtility\deleteClause(), AbstractItemProvider\getBackendUser(), BackendUtility\getCommonSelectFields(), and AbstractItemProvider\processForeignTableClause().

getBackendUser ( )
protected
getDatabaseConnection ( )
protected
Returns
DatabaseConnection

Definition at line 1292 of file AbstractItemProvider.php.

References $GLOBALS.

Referenced by AbstractItemProvider\processForeignTableClause().

getExcludeFields ( )
protected

Returns an array with the exclude fields as defined in TCA and FlexForms Used for listing the exclude fields in be_groups forms.

Returns
array Array of arrays with excludeFields (fieldName, table:fieldName) from TCA and FlexForms (fieldName, table:extKey;sheetName;fieldName)

Definition at line 644 of file AbstractItemProvider.php.

References $extConf, $GLOBALS, AbstractItemProvider\getLanguageService(), and AbstractItemProvider\getRegisteredFlexForms().

Referenced by AbstractItemProvider\addItemsFromSpecial().

getExplicitAuthFieldValues ( )
protected

Returns an array with explicit Allow/Deny fields. Used for listing these field/value pairs in be_groups forms

Returns
array Array with information from all of $GLOBALS['TCA']

Definition at line 822 of file AbstractItemProvider.php.

References $GLOBALS, and elseif.

Referenced by AbstractItemProvider\addItemsFromSpecial().

getLanguageService ( )
protected
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$resultResult array
Returns
int
Exceptions
\UnexpectedValueException

Definition at line 1242 of file AbstractItemProvider.php.

getRegisteredFlexForms (   $table)
protected

Returns all registered FlexForm definitions with title and fields

Parameters
string$tableTable to handle
Returns
array Data structures with speaking extension title

Definition at line 745 of file AbstractItemProvider.php.

References $GLOBALS, GeneralUtility\getFileAbsFileName(), GeneralUtility\getUrl(), GeneralUtility\resolveAllSheetsInDS(), GeneralUtility\trimExplode(), and GeneralUtility\xml2array().

Referenced by AbstractItemProvider\getExcludeFields().

getStaticValues (   $itemArray,
  $dynamicItemArray 
)

Determine the static values in the item array

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$itemArrayAll item records for the select field
array$dynamicItemArrayItem records from dynamic sources
Returns
array

Definition at line 1270 of file AbstractItemProvider.php.

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().

processDatabaseFieldValue ( array  $row,
  $fieldName 
)
protected

Convert the current database values into an array

Parameters
array$rowdatabase row
string$fieldNamefieldname to process
Returns
array

Definition at line 1079 of file AbstractItemProvider.php.

References GeneralUtility\trimExplode().

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().

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$resultResult array
string$foreignTableNameName of foreign table
string$localFieldNameCurrent handle field name
Returns
array Query parts with keys WHERE, ORDERBY, GROUPBY, LIMIT

Definition at line 954 of file AbstractItemProvider.php.

References MathUtility\canBeInterpretedAsInteger(), AbstractItemProvider\getDatabaseConnection(), and GeneralUtility\trimExplode().

Referenced by AbstractItemProvider\buildForeignTableQuery().

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$resultResult array
string$fieldNameCurrent handle field name
array$itemsIncoming items
Returns
array Modified item array

Definition at line 616 of file AbstractItemProvider.php.

References AbstractItemProvider\getBackendUser(), and GeneralUtility\inList().

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().

removeItemsByKeepItemsPageTsConfig ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items using "keepItems" pageTsConfig

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$resultResult array
string$fieldNameCurrent handle field name
array$itemsIncoming items
Returns
array Modified item array

Definition at line 489 of file AbstractItemProvider.php.

References ArrayUtility\keepItemsInArray().

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().

removeItemsByRemoveItemsPageTsConfig ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items using "removeItems" pageTsConfig

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$resultResult array
string$fieldNameCurrent handle field name
array$itemsIncoming items
Returns
array Modified item array

Definition at line 523 of file AbstractItemProvider.php.

References GeneralUtility\trimExplode().

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().

removeItemsByUserAuthMode ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items by user restriction on authMode items

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$resultResult array
string$fieldNameCurrent handle field name
array$itemsIncoming items
Returns
array Modified item array

Definition at line 585 of file AbstractItemProvider.php.

References AbstractItemProvider\getBackendUser().

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().

removeItemsByUserLanguageFieldRestriction ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items user restriction on language field

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$resultResult array
string$fieldNameCurrent handle field name
array$itemsIncoming items
Returns
array Modified item array

Definition at line 556 of file AbstractItemProvider.php.

References AbstractItemProvider\getBackendUser().

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().

sanitizeItemArray (   $itemArray,
  $tableName,
  $fieldName 
)

Sanitize incoming item array

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
mixed$itemArray
string$tableName
string$fieldName
Exceptions
\UnexpectedValueException
Returns
array

Definition at line 1196 of file AbstractItemProvider.php.

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().

sanitizeMaxItems (   $maxItems)

Make sure maxitems is always filled with a valid integer value.

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
mixed$maxItems
Returns
int

Definition at line 1221 of file AbstractItemProvider.php.

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().

translateLabels ( array  $result,
array  $itemArray,
  $table,
  $fieldName 
)

Translate the item labels

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$resultResult array
array$itemArrayItems
string$table
string$fieldName
Returns
array

Definition at line 1156 of file AbstractItemProvider.php.

References AbstractItemProvider\getLanguageService().

Referenced by TcaSelectItems\addData(), and TcaSelectTreeItems\addData().