You are here

public static function TrailingSlashSettingsHelper::getContentEntityTypes in Trailing Slash 8

Return value

\Drupal\Core\Entity\ContentEntityTypeInterface[]

1 call to TrailingSlashSettingsHelper::getContentEntityTypes()
SettingsForm::buildForm in src/Form/SettingsForm.php
Form constructor.

File

src/Helper/Settings/TrailingSlashSettingsHelper.php, line 61

Class

TrailingSlashSettingsHelper
Class TrailingSlashSettingsHelper

Namespace

Drupal\trailing_slash\Helper\Settings

Code

public static function getContentEntityTypes() : array {
  static $content_entity_type;
  if (!isset($content_entity_type)) {
    $entities = \Drupal::entityTypeManager()
      ->getDefinitions();
    $content_entity_type = [];
    foreach ($entities as $entity_type_id => $entity_type) {
      if ($entity_type instanceof ContentEntityType) {
        $content_entity_type[$entity_type_id] = $entity_type;
      }
    }
  }
  return $content_entity_type;
}