You are here

protected function FieldBlockController::getDefaultEntityTypes in Field as Block 8.2

Return default entity types to use as blocks.

Return value

array Entity type ids.

1 call to FieldBlockController::getDefaultEntityTypes()
FieldBlockController::getEnabledEntityTypes in src/Controller/FieldBlockController.php
Get currently enabled types either from config or module defaults.

File

src/Controller/FieldBlockController.php, line 53

Class

FieldBlockController
Class FieldBlockController.

Namespace

Drupal\fieldblock\Controller

Code

protected function getDefaultEntityTypes() {
  $default_types = [
    'node',
    'user',
    'taxonomy_term',
  ];

  // @todo Should there by an alter hook to allow other modules to make their entities default?
  $all_types = array_keys($this
    ->entityTypeManager()
    ->getDefinitions());

  // Return all default types that actually exist. "taxonomy_term" at least
  // could be disabled.
  return array_intersect($default_types, $all_types);
}