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<string|int, mixed>
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<string|int, mixed>
Apply default values.
setDefaultsFromInlineParentLanguage()  : array<string|int, mixed>
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<string|int, mixed>
Set the parent uid of inline relations created via ajax to the corresponding foreign field
setDefaultsFromInlineRelations()  : array<string|int, mixed>
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<string|int, mixed>
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<string|int, mixed>
Set defaults defined by page ts "TCAdefaults"
setDefaultsFromUserTsConfig()  : array<string|int, mixed>
Set defaults defined by user ts "TCAdefaults"
setPid()  : array<string|int, mixed>
Set the pid. This is either the vanillaUid (see description in FormDataCompiler), or a pid given by page TSconfig 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<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>

Initialized result array

Tags
throws
UnexpectedValueException
Return values
array<string|int, mixed>

setDefaultsFromDefaultValues()

Apply default values.

protected setDefaultsFromDefaultValues(array<string|int, mixed> $result) : array<string|int, mixed>

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

Parameters
$result : array<string|int, mixed>

Result array

Return values
array<string|int, mixed>

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<string|int, mixed> $result) : array<string|int, mixed>

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<string|int, mixed>

Result array

Tags
throws
UnexpectedValueException
Return values
array<string|int, mixed>

Modified result array

setDefaultsFromInlineParentUid()

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

protected setDefaultsFromInlineParentUid(array<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>

Result array

Return values
array<string|int, mixed>

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<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>

Result array

Tags
throws
UnexpectedValueException
Return values
array<string|int, mixed>

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<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>

Result array

Return values
array<string|int, mixed>

Modified result array

setDefaultsFromPageTsConfig()

Set defaults defined by page ts "TCAdefaults"

protected setDefaultsFromPageTsConfig(array<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>

Result array

Return values
array<string|int, mixed>

Modified result array

setDefaultsFromUserTsConfig()

Set defaults defined by user ts "TCAdefaults"

protected setDefaultsFromUserTsConfig(array<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>

Result array

Return values
array<string|int, mixed>

Modified result array

setPid()

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

protected setPid(array<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>

Result array

Tags
throws
UnexpectedValueException
Return values
array<string|int, mixed>

Modified result array


        
On this page

Search results