You are here

protected function FieldUtilsTrait::getFieldLabel in Scheduled Updates 8

1 call to FieldUtilsTrait::getFieldLabel()
ScheduledUpdateTypeAddAsFieldForm::save in src/Form/ScheduledUpdateTypeAddAsFieldForm.php
Form submission handler for the 'save' action.

File

src/FieldUtilsTrait.php, line 61
Contains \Drupal\scheduled_updates\FieldUtilsTrait.

Class

FieldUtilsTrait

Namespace

Drupal\scheduled_updates

Code

protected function getFieldLabel($entity_type_id, $bundle, $field_name) {
  $fields = $this
    ->FieldManager()
    ->getFieldDefinitions($entity_type_id, $bundle);
  if (isset($fields[$field_name])) {
    return $fields[$field_name]
      ->getLabel();
  }
  return '';
}