function BaseFieldDefinition::getInitialValue

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/BaseFieldDefinition.php \Drupal\Core\Field\BaseFieldDefinition::getInitialValue()
  2. 8.9.x core/lib/Drupal/Core/Field/BaseFieldDefinition.php \Drupal\Core\Field\BaseFieldDefinition::getInitialValue()
  3. 11.x core/lib/Drupal/Core/Field/BaseFieldDefinition.php \Drupal\Core\Field\BaseFieldDefinition::getInitialValue()

Returns the initial value for the field.

Return value

array The initial value for the field, as a numerically indexed array of items, each item being a property/value array (array() for no default value).

File

core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 491

Class

BaseFieldDefinition
A class for defining entity fields.

Namespace

Drupal\Core\Field

Code

public function getInitialValue() {
    return $this->normalizeValue($this->definition['initial_value'], $this->getMainPropertyName());
}

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