function FieldItemListInterface::processDefaultValue
Same name in other branches
- 9 core/lib/Drupal/Core/Field/FieldItemListInterface.php \Drupal\Core\Field\FieldItemListInterface::processDefaultValue()
- 8.9.x core/lib/Drupal/Core/Field/FieldItemListInterface.php \Drupal\Core\Field\FieldItemListInterface::processDefaultValue()
- 11.x core/lib/Drupal/Core/Field/FieldItemListInterface.php \Drupal\Core\Field\FieldItemListInterface::processDefaultValue()
Processes the default value before being applied.
Defined or configured default values of a field might need some processing in order to be a valid runtime value for the field type; e.g., a date field could process the defined value of 'NOW' to a valid date.
Parameters
array $default_value: The unprocessed default value defined for the field, as a numerically indexed array of items, each item being an array of property/value pairs.
\Drupal\Core\Entity\FieldableEntityInterface $entity: The entity for which the default value is generated.
\Drupal\Core\Field\FieldDefinitionInterface $definition: The definition of the field.
Return value
array The return default value for the field.
1 method overrides FieldItemListInterface::processDefaultValue()
- FieldItemList::processDefaultValue in core/
lib/ Drupal/ Core/ Field/ FieldItemList.php - Processes the default value before being applied.
File
-
core/
lib/ Drupal/ Core/ Field/ FieldItemListInterface.php, line 264
Class
- FieldItemListInterface
- Interface for fields, being lists of field items.
Namespace
Drupal\Core\FieldCode
public static function processDefaultValue($default_value, FieldableEntityInterface $entity, FieldDefinitionInterface $definition);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.