You are here

public function ConditionalFieldController::getEntityTypes in Conditional Fields 8

Same name and namespace in other branches
  1. 4.x src/Controller/ConditionalFieldController.php \Drupal\conditional_fields\Controller\ConditionalFieldController::getEntityTypes()

Get list of available EntityTypes.

Return value

ContentEntityTypeInterface[] List of content entity types.

1 call to ConditionalFieldController::getEntityTypes()
ConditionalFieldController::entityTypeList in src/Controller/ConditionalFieldController.php
Show entity types.

File

src/Controller/ConditionalFieldController.php, line 178

Class

ConditionalFieldController
Returns responses for conditional_fields module routes.

Namespace

Drupal\conditional_fields\Controller

Code

public function getEntityTypes() {
  $entityTypes = [];
  foreach ($this->entityTypeManager
    ->getDefinitions() as $key => $entityType) {
    if ($entityType instanceof ContentEntityType) {
      $entityTypes[$key] = $entityType;
    }
  }
  return $entityTypes;
}