$container->
get('entity_field.manager'
),
$container->
get('entity_type.manager'
),
$container->
get('entity_type.bundle.info'
),
$container->
get('entity_type.repository'
) );
} /**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) { $entity_type_labels =
$this->entityTypeRepository->
getEntityTypeLabels();
foreach ($this->entityTypeManager->
getDefinitions() as $entity_type_id =>
$entity_type) { // Only process fieldable entity types.
if (!
$entity_type->
entityClassImplements(FieldableEntityInterface::
class)) { continue;
} $bundles =
$this->entityTypeBundleInfo->
getBundleInfo($entity_type_id);
foreach ($bundles as $bundle_id =>
$bundle) { $extra_fields =
$this->entityFieldManager->
getExtraFields($entity_type_id,
$bundle_id);
// Skip bundles without any extra fields.
if (empty($extra_fields['display'
])) {