Returns an array of modules or packages that is dependent to the module name provided

@param $moduleName
@param bool $convertPackageNameToNamespace
@param bool $getOnlyActiveModules - returns only the active modules

@return array
434906
public function getChildDependencies($moduleName, $convertPackageNameToNamespace = true, $getOnlyActiveModules = true)
    {
        $modules = $this->getAllModules();
        $matchModule = $convertPackageNameToNamespace ? $moduleName : $this->convertToPackageName($moduleName);
        $dependents = [];

        foreach ($modules as $module) {
            $dependencies = $this->getDependencies($module, $convertPackageNameToNamespace);

            if ($dependencies) {
                if (in_array($matchModule, $dependencies)) {
                    $dependents[] = $convertPackageNameToNamespace ? $module : $this->convertToPackageName($module);
                }
            }
        }

        if (true === $getOnlyActiveModules) {

            $activeModules = $this->getActiveModules();
            $modules = [];

            foreach ($dependents as $module) {
                $modules[] = $module;
            }

            $dependents = $modules;
        }

        return $dependents;
    }
843008
function getModuleByNamespace (store, helper, namespace) {
  const module = store._modulesNamespaceMap[namespace]
  if (process.env.NODE_ENV !== 'production' && !module) {
    console.error(`[vuex] module namespace not found in ${helper}(): ${namespace}`)
  }
  return module
}
61315
public static function getModuleNamesWithoutRoot(Args $args, ModuleList $modules)
    {
        // Display all modules if "all" is set
        if ($args->isOptionSet('all')) {
            return $modules->getInstalledModuleNames();
        }

        $moduleNames = array();

        foreach ($args->getOption('module') as $moduleName) {
            $moduleNames[] = $moduleName;
        }

        return $moduleNames ?: $modules->getInstalledModuleNames();
    }
550752
public function getRequiredModules($moduleName) {
        $moduleName = strtolower($moduleName);
        if (isset($this->_requiredModules[$moduleName])) {
            return $this->_requiredModules[$moduleName];
        }
        else {
            return null;
        }
    }
97022
public function inModuleList(string $item, string $moduleName, string $listName)
    {
        try {
            $items = (new ModuleConfig(ConfigType::LISTS(), $moduleName, $listName))->parseToArray();
        } catch (InvalidArgumentException $e) {
            return $e->getMessage();
        }

        /** @var mixed[]|null $config */
        $inactive = $items['items'][$item]['inactive'] ?? null;
        if ($inactive === null || $inactive === true) {
            return (string)__('Invalid list item: `{0}`', $item);
        }

        return true;
    }
993901
public function getIncorrectExtensions(\OxidEsales\Eshop\Core\Module\Module $module)
    {
        $incorrect = [];
        $rawExtensions = $module->getExtensions();

        foreach ($rawExtensions as $classToBePatched => $moduleClass) {
            if (NamespaceInformationProvider::isNamespacedClass($classToBePatched)
                 && (NamespaceInformationProvider::classBelongsToShopEditionNamespace($classToBePatched)
                      || (NamespaceInformationProvider::classBelongsToShopUnifiedNamespace($classToBePatched) && !class_exists($classToBePatched))
                    )
                ) {
                $incorrect[$classToBePatched] = $moduleClass;
            }
        }
        return $incorrect;
    }
1206983
public function findByNamesWithDependencies(array $modNames): array
    {
        $result = [];
        if (count($modNames) > 0) {
            $queryBuilder = $this->entityManager->createQueryBuilder();
            $queryBuilder->select(['m', 'd', 'dm'])
                         ->from(Mod::class, 'm')
                         ->leftJoin('m.dependencies', 'd')
                         ->leftJoin('d.requiredMod', 'dm')
                         ->andWhere('m.name IN (:modNames)')
                         ->setParameter('modNames', array_values($modNames));

            $result = $queryBuilder->getQuery()->getResult();
        }
        return $result;
    }
653187
public function getModuleByName($name)
    {
        foreach ($this->modules as $module) {
            /* @var $module Module */
            if ($name == $module->getValue()->getName()) {
                return $module;
            }
        }

        return false;
    }
1251354
public function includeJsModule(string $moduleName, bool $async = false, $config = null)
    {
        return Template::raw(
            Twigpack::$plugin->manifest->getJsModuleTags($moduleName, $async, $config)
        );
    }
336253
public static function getModuleUidByClassname($moduleClassName, $moduleContainer = null)
    {
        if ($moduleContainer == null) {
            $moduleContainer = Yii::$app; // start from ancestor-container
        }
        if ($moduleContainer instanceof YiiBaseModule) {
             if ($moduleContainer::className() == $moduleClassName) {
                 return $moduleContainer->uniqueId;
             }
             $subModules = $moduleContainer->getModules($loadedOnly = false);
             foreach ($subModules as $subModule) {
                 $uid = static::getModuleUidByClassname($moduleClassName, $subModule);
                 if ($uid) return $uid;
             }
        }
        return false;
    }
1172335
@Nullable
  JSModule getModuleByName(String name) {
    for (JSModule m : modules) {
      if (m.getName().equals(name)) {
        return m;
      }
    }
    return null;
  }
710713
public function getModule($moduleName)
    {
        $moduleName = '\\' . ltrim($moduleName, '\\');
        if (!isset($this->modules[$moduleName])) {
            if ($this->proxified !== $this) {
                return $this->proxified->getModule($moduleName);
            }
            throw new \Erebot\NotFoundException('No such module "' .
                                                $moduleName . '"');
        }
        return $this->modules[$moduleName];
    }
31234
public function getModule(string $moduleName, string $type = 'modern', $config = null)
    {
        $settings = Twigpack::$plugin->getSettings();
        $config = $config ?? $settings->getAttributes();

        return ManifestHelper::getModule($config, $moduleName, $type);
    }
816374
public List<Dependency> getModuleAncestors(final String moduleName, final String moduleVersion) throws GrapesCommunicationException {
        final Client client = getClient();
        final WebResource resource = client.resource(serverURL).path(RequestUtils.getArtifactAncestors(moduleName, moduleVersion));
        final ClientResponse response = resource.queryParam(ServerAPI.SCOPE_COMPILE_PARAM, "true")
                .queryParam(ServerAPI.SCOPE_PROVIDED_PARAM, "true")
                .queryParam(ServerAPI.SCOPE_RUNTIME_PARAM, "true")
                .queryParam(ServerAPI.SCOPE_TEST_PARAM, "true")
                .accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);

        client.destroy();
        if(ClientResponse.Status.OK.getStatusCode() != response.getStatus()){
            final String message = String.format(FAILED_TO_GET_MODULE, "get module ancestors", moduleName, moduleVersion);
            if(LOG.isErrorEnabled()) {
                LOG.error(String.format(HTTP_STATUS_TEMPLATE_MSG, message, response.getStatus()));
            }
            throw new GrapesCommunicationException(message, response.getStatus());
        }

        return response.getEntity(new GenericType<List<Dependency>>(){});
    }
903840
public function findModulesByNames(array $moduleNames, PathTransfer $pathTransfer): array
    {
        $moduleTransferCollection = [];

        foreach ($moduleNames as $moduleName) {
            $moduleTransfer = $this->findModuleByName($moduleName, $pathTransfer);

            if (!$moduleTransfer->exists()) {
                continue;
            }

            $moduleTransferCollection[] = $moduleTransfer;
        }

        return $moduleTransferCollection;
    }
590457
public static function getAvailableModules()
    {
        if (!self::$_initialized) {
            self::init();
        }

        $result = [];

        foreach (self::$_modules as $ns => $module) {
            $result[] = [
                'namespace' => $ns,
                'name' => $module->name(),
                'description' => $module->description(),
                'group' => $module->group(),
                'icon' => $module->icon()
            ];
        }

        return $result;
    }
1374824
public function getActiveModuleInfo()
    {
        $aModulePaths = $this->getModuleConfigParametersByKey(static::MODULE_KEY_PATHS);

        // Extract module paths from extended classes
        if (!is_array($aModulePaths) || count($aModulePaths) < 1) {
            $aModulePaths = $this->extractModulePaths();
        }

        $aDisabledModules = $this->getDisabledModules();
        if (is_array($aDisabledModules) && count($aDisabledModules) > 0 && count($aModulePaths) > 0) {
            $aModulePaths = array_diff_key($aModulePaths, array_flip($aDisabledModules));
        }

        return $aModulePaths;
    }