throw new FieldException("Illegal field column names on {
$storage_definition->
getName()}"
);
} $field_name =
$storage_definition->
getName();
$base_table =
$this->storage->
getBaseTable();
$revision_table =
$this->storage->
getRevisionTable();
// Define the initial values, if any.
$initial_value =
$initial_value_from_field =
[];
$storage_definition_is_new =
empty($this->
loadFieldSchemaData($storage_definition));
if ($storage_definition_is_new &&
$storage_definition instanceof BaseFieldDefinition &&
$table_mapping->
allowsSharedTableStorage($storage_definition)) { if (($initial_storage_value =
$storage_definition->
getInitialValue()) && !
empty($initial_storage_value)) { // We only support initial values for fields that are stored in shared
// tables (i.e. single-value fields).
// @todo Implement initial value support for multi-value fields in
// https://www.drupal.org/node/2883851.
$initial_value =
reset($initial_storage_value);
} if ($initial_value_field_name =
$storage_definition->
getInitialValueFromField()) { // Check that the field used for populating initial values is valid.
if (!
isset($this->fieldStorageDefinitions
[$initial_value_field_name])) { throw new FieldException("Illegal initial value definition on {
$storage_definition->
getName()}: The field
$initial_value_field_name does not exist."
);
}