$summary[] =
new TranslatableMarkup('Reference type: @entity_type',
[ '@entity_type' =>
$target_type_info->
getLabel(),
]);
} return $summary;
} /**
* {@inheritdoc}
*/
public static function fieldSettingsSummary(FieldDefinitionInterface
$field_definition): array
{ $summary = parent::
fieldSettingsSummary($field_definition);
$target_type =
$field_definition->
getFieldStorageDefinition()->
getSetting('target_type'
);
$handler_settings =
$field_definition->
getSetting('handler_settings'
);
if (!
isset($handler_settings['target_bundles'
])) { return $summary;
} /** @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_bundle_information */
$entity_bundle_information = \Drupal::
service('entity_type.bundle.info'
);
$bundle_info =
$entity_bundle_information->
getBundleInfo($target_type);
$bundles =
array_map(fn($bundle) =>
$bundle_info[$bundle]['label'
],
$handler_settings['target_bundles'
]);