W3cubDocs

/Drupal 8

public static function FieldItemListInterface::processDefaultValue

public static FieldItemListInterface::processDefaultValue($default_value, FieldableEntityInterface $entity, FieldDefinitionInterface $definition)

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: 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.

File

core/lib/Drupal/Core/Field/FieldItemListInterface.php, line 259

Class

FieldItemListInterface
Interface for fields, being lists of field items.

Namespace

Drupal\Core\Field

Code

public static function processDefaultValue($default_value, FieldableEntityInterface $entity, FieldDefinitionInterface $definition);

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Field!FieldItemListInterface.php/function/FieldItemListInterface::processDefaultValue/8.1.x