You are here

public function Tracker::getAvailableEntityTypes in Menu Entity Index 8

Gets Content Entity Type Ids, that are available for tracking.

Return value

array Entity Type Ids available for tracking.

Overrides TrackerInterface::getAvailableEntityTypes

File

src/Tracker.php, line 191

Class

Tracker
Tracks menu links and their referenced entities.

Namespace

Drupal\menu_entity_index

Code

public function getAvailableEntityTypes() {
  $options = [];
  $types = $this->entityTypeManager
    ->getDefinitions();
  foreach ($types as $type_id => $type) {
    if ($type instanceof ContentEntityType) {
      $options[$type_id] = $type
        ->getLabel();
    }
  }
  if (isset($options['menu_link_content'])) {
    unset($options['menu_link_content']);
  }
  return $options;
}