You are here

protected function MailhandlerComment::getEntityTypes in Mailhandler 8

Returns an array of entity types.

Return value

array An array of entity types.

1 call to MailhandlerComment::getEntityTypes()
MailhandlerComment::buildConfigurationForm in mailhandler_comment/src/Plugin/inmail/Handler/MailhandlerComment.php

File

mailhandler_comment/src/Plugin/inmail/Handler/MailhandlerComment.php, line 168

Class

MailhandlerComment
Message handler that supports posting comments via email.

Namespace

Drupal\mailhandler_comment\Plugin\inmail\Handler

Code

protected function getEntityTypes() {

  // Get a mapping of entity types (bundles) with comment fields.
  $comment_entity_types = \Drupal::entityManager()
    ->getFieldMapByFieldType('comment');
  $entity_types = [];
  foreach ($comment_entity_types as $entity_type => $bundles) {
    $entity_types[$entity_type] = $this->entityTypeManager
      ->getDefinition($entity_type)
      ->getLabel();
  }
  return $entity_types;
}