You are here

function _comment_notify_get_comment_enabled_bundles in Comment Notify 8

Returns array of comment notify enabled entity type & bundles.

1 call to _comment_notify_get_comment_enabled_bundles()
comment_notify_form_user_form_alter in ./comment_notify.module
Implements hook_form_alter().

File

./comment_notify.module, line 215
This module provides comment follow-up e-mail notifications.

Code

function _comment_notify_get_comment_enabled_bundles() {
  $field_manager = \Drupal::service('entity_field.manager');
  $bundles_with_comment_fields = [];
  $comment_field_map = $field_manager
    ->getFieldMapByFieldType('comment');
  foreach ($comment_field_map as $entity_type => $comment_fields) {
    foreach ($comment_fields as $field_name => $field_info) {
      foreach ($field_info['bundles'] as $field_bundle) {
        $bundles_with_comment_fields[$entity_type] = $field_bundle;
      }
    }
  }
  return $bundles_with_comment_fields;
}