return $element;
} /**
* {@inheritdoc}
*/
public function fieldSettingsForm(array
$form, FormStateInterface
$form_state) { $field =
$form_state->
getFormObject()->
getEntity();
// Get all selection plugins for this entity type.
$selection_plugins = \Drupal::
service('plugin.manager.entity_reference_selection'
)->
getSelectionGroups($this->
getSetting('target_type'
));
$handlers_options =
[];
foreach (array_keys($selection_plugins) as $selection_group_id) { // We only display base plugins (e.g. 'default', 'views', ...) and not
// entity type specific plugins (e.g. 'default:node', 'default:user',
// ...).
if (array_key_exists($selection_group_id,
$selection_plugins[$selection_group_id])) { $handlers_options[$selection_group_id] = Html::
escape($selection_plugins[$selection_group_id][$selection_group_id]['label'
]);
} elseif (array_key_exists($selection_group_id . ':' .
$this->
getSetting('target_type'
),
$selection_plugins[$selection_group_id])) { $selection_group_plugin =
$selection_group_id . ':' .
$this->
getSetting('target_type'
);
$handlers_options[$selection_group_plugin] = Html::
escape($selection_plugins[$selection_group_id][$selection_group_plugin]['base_plugin_label'
]);
}