Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CommentManager.php

function CommentManager::getFields

File

core/modules/comment/src/CommentManager.php, line 108

Class

CommentManager
Comment manager contains common functions to manage comment fields.

Namespace

Drupal\comment

Code

public function getFields($entity_type_id) {
    $entity_type = $this->entityTypeManager
        ->getDefinition($entity_type_id);
    if (!$entity_type->entityClassImplements(FieldableEntityInterface::class)) {
        return [];
    }
    $map = $this->entityFieldManager
        ->getFieldMapByFieldType('comment');
    return $map[$entity_type_id] ?? [];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal