[SaveToDatabase]¶
Properties¶
implementationClassName¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.implementationClassName
- Data type
string
- Needed by
Frontend
- Mandatory
Yes
- Default value
1SaveToDatabase: 2 implementationClassName: TYPO3\CMS\Form\Domain\Finishers\SaveToDatabaseFinisher
- Good to know
- Description
Classname which implements the finisher.
options.table¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.options.table
- Data type
string
- Needed by
Frontend
- Mandatory
Yes
- Default value
null
- Good to know
- Description
Insert or update values into this table.
options.mode¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.options.mode
- Data type
string
- Needed by
Frontend
- Mandatory
No
- Default value
'insert'
- Possible values
insert/ update
- Good to know
- Description
insert
will create a new database row with the values from the submitted form and/or some predefined values. @see options.elements and options.databaseFieldMappingsupdate
will update a given database row with the values from the submitted form and/or some predefined values. 'options.whereClause' is then required.
options.whereClause¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.options.whereClause
- Data type
array
- Needed by
Frontend
- Mandatory
Yes, if mode = update
- Default value
empty array
- Good to know
- Description
This where clause will be used for a database update action.
options.elements¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.options.elements
- Data type
array
- Needed by
Frontend
- Mandatory
Yes
- Default value
empty array
- Good to know
- Description
Use
options.elements
to map form element values to existing database columns. Each key withinoptions.elements
has to match with a form element identifier. The value for each key withinoptions.elements
is an array with additional informations.
options.elements.<formElementIdentifier>.mapOnDatabaseColumn¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.options.elements.<formElementIdentifier>.mapOnDatabaseColumn
- Data type
string
- Needed by
Frontend
- Mandatory
Yes
- Default value
undefined
- Good to know
- Description
The value from the submitted form element with the identifier
<formElementIdentifier>
will be written into this database column.
options.elements.<formElementIdentifier>.saveFileIdentifierInsteadOfUid¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.options.elements.<formElementIdentifier>.saveFileIdentifierInsteadOfUid
- Data type
bool
- Needed by
Frontend
- Mandatory
No
- Default value
false
- Good to know
- Description
Set this to true if the database column should not be written if the value from the submitted form element with the identifier
<formElementIdentifier>
is empty (think about password fields etc.).This setting only rules for form elements which creates a FAL object like
FileUpload
orImageUpload
. By default, the uid of the FAL object will be written into the database column. Set this to true if you want to store the FAL identifier (1:/user_uploads/some_uploaded_pic.jpg) instead.
options.elements.<formElementIdentifier>.skipIfValueIsEmpty¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.options.elements.<formElementIdentifier>.skipIfValueIsEmpty
- Data type
bool
- Needed by
Frontend
- Mandatory
No
- Default value
false
- Good to know
- Description
Set this to true if the database column should not be written if the value from the submitted form element with the identifier
<formElementIdentifier>
is empty (think about password fields etc.). Empty means strings without content, whitespace is valid content.
options.elements.<formElementIdentifier>.dateFormat¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.options.elements.<formElementIdentifier>.dateFormat
- Data type
string
- Needed by
Frontend
- Mandatory
No
- Default value
'U'
- Good to know
- Description
If the internal Datatype is DateTime which is true for the form element types "DatePicker" and "Date", the object needs to be converted into a string value. This option allows you to define the format of the date. You can use every format accepted by PHP's date() function (https://php.net/manual/en/function.date.php#refsect1-function.date-parameters). The default value is "U" which means a Unix timestamp.
options.databaseColumnMappings¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.options.databaseColumnMappings
- Data type
array
- Needed by
Frontend
- Mandatory
No
- Default value
empty array
- Good to know
- Description
Use this to map database columns to static values. Each key within
options.databaseColumnMappings
has to match with an existing database column. The value for each key withinoptions.databaseColumnMappings
is an array with additional informations.This mapping is done before the
options.element
mapping. This means if you map a database column to a value throughoptions.databaseColumnMappings
and map a submitted form element value to the same database column throughoptions.element
, the submitted form element value will override the value you set withinoptions.databaseColumnMappings
.
options.databaseColumnMappings.<databaseColumnName>.value¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.options.databaseColumnMappings.<databaseColumnName>.value
- Data type
string
- Needed by
Frontend
- Mandatory
Yes
- Default value
undefined
- Good to know
- Description
The value which will be written to the database column. You can also use the FormRuntime accessor feature to access every getable property from the
FormRuntime
In short: use something like{<formElementIdentifier>}
to get the value from the submitted form element with the identifier<formElementIdentifier>
.If you use the FormRuntime accessor feature within
options.databaseColumnMappings
the functionality is nearly equal to theoptions.elements
configuration variant.
options.databaseColumnMappings.<databaseColumnName>.skipIfValueIsEmpty¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.options.databaseColumnMappings.<databaseColumnName>.skipIfValueIsEmpty
- Data type
bool
- Needed by
Frontend
- Mandatory
No
- Default value
undefined
- Good to know
- Description
Set this to true if the database column should not be written if the value from
options.databaseColumnMappings. <databaseColumnName>.value
is empty. Empty means strings without content, whitespace is valid content.
options.translation.translationFiles¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.options.translation.translationFiles
- Data type
string/ array
- Needed by
Frontend
- Mandatory
No
- Default value
undefined
- Good to know
- Description
If set, this translation file(s) will be used for finisher option translations. If not set, the translation file(s) from the 'Form' element will be used. Read Translate finisher options for more informations.
formeditor.iconIdentifier¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.formEditor.iconIdentifier
- Data type
string
- Needed by
Backend (form editor)
- Mandatory
Yes
- Default value
1SaveToDatabase: 2 formEditor: 3 iconIdentifier: form-finisher 4 label: formEditor.elements.Form.finisher.SaveToDatabase.editor.header.label 5 predefinedDefaults: 6 options: { }
- Description
An icon identifier which must be registered through the
\TYPO3\CMS\Core\Imaging\IconRegistry
. This icon will be shown within the - "Inspector [CollectionElementHeaderEditor]" if the finisher is selected.
formeditor.label¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.formEditor.label
- Data type
string
- Needed by
Backend (form editor)
- Mandatory
Yes
- Default value
1SaveToDatabase: 2 formEditor: 3 iconIdentifier: form-finisher 4 label: formEditor.elements.Form.finisher.SaveToDatabase.editor.header.label 5 predefinedDefaults: 6 options: { }
- Good to know
- Description
This label will be shown within the - "Inspector [CollectionElementHeaderEditor]" if the finisher is selected.
formeditor.predefinedDefaults¶
- Option path
TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.finishersDefinition.SaveToDatabase.formEditor.predefinedDefaults
- Data type
array
- Needed by
Backend (form editor)
- Mandatory
No
- Default value
1SaveToDatabase: 2 formEditor: 3 iconIdentifier: form-finisher 4 label: formEditor.elements.Form.finisher.SaveToDatabase.editor.header.label 5 predefinedDefaults: 6 options: { }
- Description
Defines predefined defaults for finisher options which are prefilled, if the finisher is added to a form.