You are here

protected function FieldUtilsTrait::getBundleDestinationOptions in Scheduled Updates 8

1 call to FieldUtilsTrait::getBundleDestinationOptions()
ScheduledUpdateTypeBaseForm::createCloneFieldSelect in src/Form/ScheduledUpdateTypeBaseForm.php
Create an option to select one field to clone on type add form.

File

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

Class

FieldUtilsTrait

Namespace

Drupal\scheduled_updates

Code

protected function getBundleDestinationOptions($entity_type_id, $bundle) {
  $destination_fields = [];
  $fields = $this
    ->FieldManager()
    ->getFieldDefinitions($entity_type_id, $bundle);
  foreach ($fields as $field_id => $field) {
    if ($this
      ->isDestinationFieldCompatible($field
      ->getFieldStorageDefinition())) {
      $destination_fields[$field_id] = $field
        ->getLabel();
    }
  }
  return $destination_fields;
}