/** @var \Drupal\Component\Plugin\Discovery\DiscoveryInterface $field_type_manager */
$field_type_manager = \Drupal::
service('plugin.manager.field.field_type'
);
/** @var \Drupal\Component\Plugin\Discovery\DiscoveryInterface $field_type_manager */
$field_formatter_manager = \Drupal::
service('plugin.manager.field.formatter'
);
/** @var \Drupal\Component\Plugin\Discovery\DiscoveryInterface $field_type_manager */
$field_widget_manager = \Drupal::
service('plugin.manager.field.widget'
);
// Load the IDs of all available field type plugins.
$available_field_type_ids =
[];
foreach ($field_type_manager->
getDefinitions() as $definition) { $available_field_type_ids[] =
$definition['id'
];
} // Load the IDs of all available field widget plugins.
$available_field_widget_ids =
[];
foreach ($field_widget_manager->
getDefinitions() as $definition) { $available_field_widget_ids[] =
$definition['id'
];
} // Load the IDs of all available field formatter plugins.
$available_field_formatter_ids =
[];