You are here

public function FieldManager::fieldNameExists in Scheduled Updates 8

Checks if a field machine name is taken.

Copied from \Drupal\field_ui\Form\FieldStorageAddForm::fieldNameExists

Parameters

$field_name:

$entity_type_id:

Return value

bool Whether or not the field machine name is taken. Whether or not the field machine name is taken.

Overrides FieldManagerInterface::fieldNameExists

1 call to FieldManager::fieldNameExists()
FieldManager::createNonExistingFieldName in src/FieldManager.php
Create an used field name adding the suffix number until an used one is found.

File

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

Class

FieldManager
Field Manager for handling fields for Scheduled Updates.

Namespace

Drupal\scheduled_updates

Code

public function fieldNameExists($field_name, $entity_type_id) {
  $definition = $this
    ->getFieldStorageDefinition($entity_type_id, $field_name);
  return !empty($definition);
}