You are here

function _hashtags_get_content_entity_types in Hashtags 8

Get Content Entity Types

Parameters

array $excluded_types:

Return value

array

2 calls to _hashtags_get_content_entity_types()
hashtags_uninstall in ./hashtags.install
Implements hook_uninstall().
ManagerForm::buildForm in src/Form/ManagerForm.php
Form constructor.

File

./hashtags.module, line 372

Code

function _hashtags_get_content_entity_types($excluded_types = [
  'block_content',
  'contact_message',
  'file',
  'shortcut',
  'menu_link_content',
]) {
  $definitions = \Drupal::entityTypeManager()
    ->getDefinitions();
  $types = [];
  foreach ($definitions as $id => $definition) {
    if ($definition instanceof ContentEntityType && !in_array($id, $excluded_types)) {
      $types[$id] = $id;
    }
  }
  return $types;
}