function FieldDefaultValueCallbackProvider::calculateDefaultValue

Same name in other branches
  1. 8.9.x core/modules/field/tests/modules/field_test/src/FieldDefaultValueCallbackProvider.php \Drupal\field_test\FieldDefaultValueCallbackProvider::calculateDefaultValue()
  2. 10 core/modules/field/tests/modules/field_test/src/FieldDefaultValueCallbackProvider.php \Drupal\field_test\FieldDefaultValueCallbackProvider::calculateDefaultValue()
  3. 11.x core/modules/field/tests/modules/field_test/src/FieldDefaultValueCallbackProvider.php \Drupal\field_test\FieldDefaultValueCallbackProvider::calculateDefaultValue()

Helper callback calculating a default value.

File

core/modules/field/tests/modules/field_test/src/FieldDefaultValueCallbackProvider.php, line 13

Class

FieldDefaultValueCallbackProvider
Helper class for \Drupal\Tests\field\Functional\FieldDefaultValueCallbackTest.

Namespace

Drupal\field_test

Code

public static function calculateDefaultValue() {
    return [
        [
            'value' => 'Calculated default value',
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.