‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline:
TYPO3\CMS\Backend\Form\FormDataProvider\AbstractDatabaseRecordProvider TYPO3\CMS\Backend\Form\FormDataProviderInterface

Public Member Functions

array addData (array $result)
 

Protected Member Functions

bool isInlineField ($fieldConfig)
 
bool isUserAllowedToModify ($fieldConfig)
 
array addInlineFirstPid (array $result)
 
array resolveRelatedRecordsOverlays (array $result, $fieldName)
 
array resolveRelatedRecords (array $result, $fieldName)
 
array addForeignSelectorAndUniquePossibleRecords (array $result, $fieldName)
 
array compileChild (array $result, $parentFieldName, $childUid)
 
array compileChildChild (array $child, array $parentConfig)
 
int[] getSubstitutedWorkspacedUids (array $connectedUids, string $childTableName)
 
array resolveConnectedRecordUids (array $parentConfig, $parentTableName, $parentUid, $parentFieldValue)
 
int getLiveDefaultId ($tableName, $uid)
 
 getChildChildTableName (string $foreignSelector, array $childConfiguration)
 
 getBackendUser ()
 
 getLanguageService ()
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Backend\Form\FormDataProvider\AbstractDatabaseRecordProvider
array getRecordFromDatabase ($tableName, $uid)
 
 getDatabaseRow (string $tableName, int $uid)
 

Detailed Description

Resolve and prepare inline data.

Definition at line 38 of file TcaInline.php.

Member Function Documentation

◆ addData()

◆ addForeignSelectorAndUniquePossibleRecords()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::addForeignSelectorAndUniquePossibleRecords ( array  $result,
  $fieldName 
)
protected

If there is a foreign_selector or foreign_unique configuration, fetch the list of possible records that can be connected and attach the to the inline configuration.

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

Definition at line 276 of file TcaInline.php.

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

◆ addInlineFirstPid()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::addInlineFirstPid ( array  $result)
protected

The "entry" pid for inline records. Nested inline records can potentially hang around on different pid's, but the entry pid is needed for AJAX calls, so that they would know where the action takes place on the page structure.

Parameters
array$result‪Incoming result
Returns
‪array Modified result
Todo:
‪: Find out when and if this is different from 'effectivePid'

Definition at line 96 of file TcaInline.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger().

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

◆ compileChild()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::compileChild ( array  $result,
  $parentFieldName,
  $childUid 
)
protected

◆ compileChildChild()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::compileChildChild ( array  $child,
array  $parentConfig 
)
protected

With useCombination set, not only content of the intermediate table, but also the connected child should be rendered in one go. Prepare this here.

Parameters
array$child‪Full data array of "mm" record
array$parentConfig‪TCA configuration of "parent"
Returns
‪array Full data array of child

Definition at line 399 of file TcaInline.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\getChildChildTableName().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\compileChild().

◆ getBackendUser()

TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::getBackendUser ( )
protected

◆ getChildChildTableName()

TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::getChildChildTableName ( string  $foreignSelector,
array  $childConfiguration 
)
protected

The child-child table name is set in the child TCA "the selector field" and is depending on the TCA type (select or group) either the "foreign_table" or the (first) "allowed" table.

Definition at line 508 of file TcaInline.php.

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

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\compileChildChild().

◆ getLanguageService()

TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::getLanguageService ( )
protected

Definition at line 525 of file TcaInline.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\compileChild().

◆ getLiveDefaultId()

int TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::getLiveDefaultId (   $tableName,
  $uid 
)
protected

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

Parameters
string$tableName
int$uid
Returns
‪int
Todo:
‪: the workspace mess still must be resolved somehow

Definition at line 495 of file TcaInline.php.

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

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\resolveConnectedRecordUids().

◆ getSubstitutedWorkspacedUids()

int [] TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::getSubstitutedWorkspacedUids ( array  $connectedUids,
string  $childTableName 
)
protected

Substitute given list of uids in child table with workspace uid if needed

Parameters
array$connectedUids‪List of connected uids
string$childTableName‪Name of child table
Returns
‪int[] List of substituted uids

Definition at line 431 of file TcaInline.php.

References TYPO3\CMS\Webhooks\Message\$uid, and TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\getBackendUser().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\resolveRelatedRecords(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\resolveRelatedRecordsOverlays().

◆ isInlineField()

bool TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::isInlineField (   $fieldConfig)
protected

Is column of type "inline"

Parameters
array$fieldConfig
Returns
‪bool

Definition at line 72 of file TcaInline.php.

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

◆ isUserAllowedToModify()

bool TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::isUserAllowedToModify (   $fieldConfig)
protected

Is user allowed to modify child elements

Parameters
array$fieldConfig
Returns
‪bool

Definition at line 83 of file TcaInline.php.

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

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

◆ resolveConnectedRecordUids()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::resolveConnectedRecordUids ( array  $parentConfig,
  $parentTableName,
  $parentUid,
  $parentFieldValue 
)
protected

Use RelationHandler to resolve connected uids.

Parameters
array$parentConfig‪TCA config section of parent
string$parentTableName‪Name of parent table
int$parentUid‪Uid of parent record
string$parentFieldValue‪Database value of parent record of this inline field
Returns
‪array Array with connected uids
Todo:
‪: Cover with unit tests

Definition at line 462 of file TcaInline.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\getLiveDefaultId(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\resolveRelatedRecords(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\resolveRelatedRecordsOverlays().

◆ resolveRelatedRecords()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::resolveRelatedRecords ( array  $result,
  $fieldName 
)
protected

Substitute the value in databaseRow of this inline field with an array that contains the databaseRows of currently connected records and some meta information.

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

Definition at line 237 of file TcaInline.php.

References TYPO3\CMS\Webhooks\Message\$uid, TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\compileChild(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\getSubstitutedWorkspacedUids(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\resolveConnectedRecordUids(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\resolveRelatedRecordsOverlays().

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

◆ resolveRelatedRecordsOverlays()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::resolveRelatedRecordsOverlays ( array  $result,
  $fieldName 
)
protected

Substitute the value in databaseRow of this inline field with an array that contains the databaseRows of currently connected records and some meta information.

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

Definition at line 135 of file TcaInline.php.

References $GLOBALS, TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\compileChild(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractDatabaseRecordProvider\getRecordFromDatabase(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\getSubstitutedWorkspacedUids(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\resolveConnectedRecordUids().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\resolveRelatedRecords().