nullable¶
Changed in version 12.0
This option was introduced to replace the TCA eval
option with
null
as value.
-
nullable (type => datetime)
¶ -
- Path
-
$GLOBALS['TCA'][$table]['columns'][$field]['config']
- type
-
boolean
- Default
-
false
- Scope
-
Proc
If set to true, a checkbox will appear, which by default deactivates the field. In the deactivated state the field is saved as
NULL
in the database. By activating the checkbox it is possible to set a value. If nothing is entered into the field, then an empty string will be saved and not aNULL
.The database field must allow the
NULL
value.
Example:
'columns' => [
'nullable_column' => [
'title' => 'A nullable field',
'config' => [
'type' => 'datetime',
'nullable' => true,
],
],
],
Copied!