function CommentHooks::fieldInfoEntityTypeUiDefinitionsAlter

Same name and namespace in other branches
  1. main core/modules/comment/src/Hook/CommentHooks.php \Drupal\comment\Hook\CommentHooks::fieldInfoEntityTypeUiDefinitionsAlter()

Implements hook_field_info_entity_type_ui_definitions_alter().

Attributes

#[Hook('field_info_entity_type_ui_definitions_alter')]

File

core/modules/comment/src/Hook/CommentHooks.php, line 203

Class

CommentHooks
Hook implementations for comment.

Namespace

Drupal\comment\Hook

Code

public function fieldInfoEntityTypeUiDefinitionsAlter(array &$ui_definitions, string $entity_type_id) : void {
  $entity_type = \Drupal::entityTypeManager()->getDefinition($entity_type_id);
  if (!$entity_type->hasIntegerId()) {
    unset($ui_definitions['comment']);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.