You are here

public static function TrailingSlashSettingsHelper::getActiveBundles in Trailing Slash 8

Return value

array

1 call to TrailingSlashSettingsHelper::getActiveBundles()
TrailingSlashOutboundPathProcessor::isBundlePathWithTrailingSlash in src/PathProcessor/TrailingSlashOutboundPathProcessor.php

File

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

Class

TrailingSlashSettingsHelper
Class TrailingSlashSettingsHelper

Namespace

Drupal\trailing_slash\Helper\Settings

Code

public static function getActiveBundles() : array {
  static $bundles;
  if (!isset($bundles)) {
    $bundles = [];
    $config = \Drupal::config('trailing_slash.settings');
    $enabled_entity_types = unserialize($config
      ->get('enabled_entity_types'));
    foreach ($enabled_entity_types as $entity_type_key => $entity_type) {
      $enabled_bundles = array_filter($entity_type);
      if (!empty($enabled_bundles)) {
        $bundles[$entity_type_key] = $enabled_bundles;
      }
    }
  }
  return $bundles;
}