You are here

public static function WebformReflectionHelper::getSubModules in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Utility/WebformReflectionHelper.php \Drupal\webform\Utility\WebformReflectionHelper::getSubModules()

Get a list of Webform submodules.

Return value

array A list of Webform submodules.

3 calls to WebformReflectionHelper::getSubModules()
Webform::createDuplicate in src/Entity/Webform.php
Creates a duplicate of the entity.
webform_update_8045 in includes/webform.install.update.inc
Issue #2878307: webform example module disable causes a customized webform deleted.
_webform_update_8045_is_submodule_config in includes/webform.install.update.inc
Check if config is from a Webform submodule.

File

src/Utility/WebformReflectionHelper.php, line 23

Class

WebformReflectionHelper
Helper class for reflection methods.

Namespace

Drupal\webform\Utility

Code

public static function getSubModules() {
  if (isset(self::$modules)) {
    return self::$modules;
  }
  self::$modules = [];
  $files = \Drupal::service('file_system')
    ->scanDirectory(drupal_get_path('module', 'webform') . '/modules', '/.*\\.info\\.yml/');
  foreach ($files as $file) {
    $module_name = str_replace('.info.yml', '', $file->filename);
    self::$modules[$module_name] = $module_name;
  }
  return self::$modules;
}