You are here

protected function FieldManager::getNewFieldName in Scheduled Updates 8

Gets the first available field name for a give source field.

@internal param \Drupal\scheduled_updates\ScheduledUpdateTypeInterface $scheduled_update_type

Parameters

\Drupal\Core\Field\FieldStorageDefinitionInterface $definition:

Return value

string

1 call to FieldManager::getNewFieldName()
FieldManager::cloneField in src/FieldManager.php
[@inheritdoc}

File

src/FieldManager.php, line 119
Contains \Drupal\scheduled_updates\FieldManager.

Class

FieldManager
Field Manager for handling fields for Scheduled Updates.

Namespace

Drupal\scheduled_updates

Code

protected function getNewFieldName(FieldStorageDefinitionInterface $definition) {
  $field_name = $definition
    ->getName();
  if ($definition
    ->isBaseField()) {
    $field_name = $this->configFactory
      ->get('field_ui.settings')
      ->get('field_prefix') . $field_name;
  }
  return $this
    ->createNonExistingFieldName($field_name, 'scheduled_update');
}