DatabaseRowInitializeNew

class \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowInitializeNew

Implements
FormDataProviderInterface

On "new" command, initialize new database row with default data

Table of Contents

Interfaces

FormDataProviderInterface
Interface must be implemented by form data provider classes.

Methods

addData()  : array
Initialize new row with default values from various sources There are 4 sources of default values. Mind the order, the last takes precedence.
setDefaultsFromDefaultValues()  : array
Apply default values.
setDefaultsFromInlineParentLanguage()  : array
If a new child is created in an inline relation via ajax, and if the parent is a localized record, the child should have the same sys_language_uid set in the field declared in ['ctrl']['languageField'] if the child is localizable itself.
setDefaultsFromInlineParentUid()  : array
Set the parent uid of inline relations created via ajax to the corresponding foreign field
setDefaultsFromInlineRelations()  : array
Inline scenario if a new intermediate record to an existing child-child is compiled. Set "foreign_selector" field of this intermediate row to given "childChildUid". See TcaDataCompiler array comment of inlineChildChildUid for more details.
setDefaultsFromNeighborRow()  : array
If a neighbor row is given (if vanillaUid was negative), field can be initialized with values from neighbor for fields registered in TCA['ctrl']['useColumnsForDefaultValues'].
setDefaultsFromPageTsConfig()  : array
Set defaults defined by page ts "TCAdefaults"
setDefaultsFromUserTsConfig()  : array
Set defaults defined by user ts "TCAdefaults"
setPid()  : array
Set the pid. This is either the vanillaUid (see description in FormDataCompiler), or a pid given by pageTsConfig for inline children.

Methods

addData()

Initialize new row with default values from various sources There are 4 sources of default values. Mind the order, the last takes precedence.

public addData(array $result) : array

Parameters

$result : array

Tags

throws
UnexpectedValueException

Return values

array

setDefaultsFromDefaultValues()

Apply default values.

protected setDefaultsFromDefaultValues(array $result) : array

These are typically carried around as "defVals" GET vars and set by controllers in $result['defaultValues'] array as init values.

Parameters

$result : array

Result array

Return values

array —

Modified result array

setDefaultsFromInlineParentLanguage()

If a new child is created in an inline relation via ajax, and if the parent is a localized record, the child should have the same sys_language_uid set in the field declared in ['ctrl']['languageField'] if the child is localizable itself.

protected setDefaultsFromInlineParentLanguage(array $result) : array

A localized parent transfers its sys_language_uid via inlineParentConfig['inline']['parentSysLanguageUid'], use that value as default for the child record languageField.

Parameters

$result : array

Result array

Tags

throws
UnexpectedValueException

Return values

array —

Modified result array

setDefaultsFromInlineParentUid()

Set the parent uid of inline relations created via ajax to the corresponding foreign field

protected setDefaultsFromInlineParentUid(array $result) : array

Parameters

$result : array

Result array

Return values

array

setDefaultsFromInlineRelations()

Inline scenario if a new intermediate record to an existing child-child is compiled. Set "foreign_selector" field of this intermediate row to given "childChildUid". See TcaDataCompiler array comment of inlineChildChildUid for more details.

protected setDefaultsFromInlineRelations(array $result) : array

Parameters

$result : array

Result array

Tags

throws
UnexpectedValueException

Return values

array —

Modified result array

setDefaultsFromNeighborRow()

If a neighbor row is given (if vanillaUid was negative), field can be initialized with values from neighbor for fields registered in TCA['ctrl']['useColumnsForDefaultValues'].

protected setDefaultsFromNeighborRow(array $result) : array

Parameters

$result : array

Result array

Return values

array —

Modified result array

setDefaultsFromPageTsConfig()

Set defaults defined by page ts "TCAdefaults"

protected setDefaultsFromPageTsConfig(array $result) : array

Parameters

$result : array

Result array

Return values

array —

Modified result array

setDefaultsFromUserTsConfig()

Set defaults defined by user ts "TCAdefaults"

protected setDefaultsFromUserTsConfig(array $result) : array

Parameters

$result : array

Result array

Return values

array —

Modified result array

setPid()

Set the pid. This is either the vanillaUid (see description in FormDataCompiler), or a pid given by pageTsConfig for inline children.

protected setPid(array $result) : array

Parameters

$result : array

Result array

Tags

throws
UnexpectedValueException

Return values

array —

Modified result array

On this page