protected property FieldConfigBase::$default_value in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Field/FieldConfigBase.php \Drupal\Core\Field\FieldConfigBase::default_value
Default field value.
The default value is used when an entity is created, either:
- through an entity creation form; the form elements for the field are prepopulated with the default value.
- through direct API calls (i.e. $entity->save()); the default value is added if the $entity object provides no explicit entry (actual values or "the field is empty") for the field.
The default value is expressed as a numerically indexed array of items, each item being an array of key/value pairs matching the set of 'columns' defined by the "field schema" for the field type, as exposed in hook_field_schema(). If the number of items exceeds the cardinality of the field, extraneous items will be ignored.
This property is overlooked if the $default_value_callback is non-empty.
Example for a integer field:
array(
array(
'value' => 1,
),
array(
'value' => 2,
),
);
Type: array
File
- core/
lib/ Drupal/ Core/ Field/ FieldConfigBase.php, line 147 - Contains \Drupal\Core\Field\FieldConfigBase.
Class
- FieldConfigBase
- Base class for configurable field definitions.
Namespace
Drupal\Core\FieldCode
protected $default_value = array();