Gets a module

@param string $moduleName
@return AModule|null
550752
public function getRequiredModules($moduleName) {
        $moduleName = strtolower($moduleName);
        if (isset($this->_requiredModules[$moduleName])) {
            return $this->_requiredModules[$moduleName];
        }
        else {
            return null;
        }
    }
71397
public function module($module = null)
    {
        if (!is_null($module)) {
            $this->module = $module;
            return $this;
        } else {
            return $this->module ?: '';
        }
    }
854777
public function getModule($key) {
        if (isset($this->_modules[$key])) {
            return $this->_modules[$key];
        }

        throw new MissingModuleException(sprintf('Could not locate %s module', $key));
    }
940622
public function resolveModuleOptionsByModuleName($moduleName)
    {
        if (array_key_exists($moduleName, $this->moduleNameToModuleOptions)) {
            $moduleOptions = $this->moduleNameToModuleOptions[$moduleName];
        } else {
            $event = $this->eventFactory();
            $event->setName(ModuleOptionsEventInterface::LOAD_MODULE_OPTIONS_EVENT);
            $event->setTarget($this);
            $event->setModuleName($moduleName);

            $eventCollections = $this->getEventManager()->trigger($event, function ($result) {
                return $result instanceof ModuleOptionsInterface;
            });

            $moduleOptionsResult = $eventCollections->last();

            $moduleOptions = $this->isValidModuleOptions($moduleOptionsResult) ? $moduleOptionsResult : null;
            $this->moduleNameToModuleOptions[$moduleName] = $moduleOptions;
        }

        return $moduleOptions;
    }
924663
public function getModule($name){
        if(isset($this->modules[$name])){
            return $this->modules[$name];
        }
        return NULL;
    }
938288
private function get_provide_event_action_num_params(string $modulename) {
        $functionname = 'mod_' . $modulename . '_core_calendar_provide_event_action';
        $reflection = new \ReflectionFunction($functionname);
        return $reflection->getNumberOfParameters();
    }
1349034
public function getModuleNameByClassName($className)
    {
        $resultModuleName = $this->autoDetectModuleNameByClassName($className);
        if (null === $resultModuleName) {
            $errMsg = sprintf('Unable to determine the module name for a class of %s', $className);
            throw new Exception\ResolveModuleNameException($errMsg);
        }

        return $resultModuleName;
    }
1207130
public function getInstallInfo($moduleName)
    {
        if (!isset($this->installInfos[$moduleName])) {
            throw new NoSuchModuleException(sprintf(
                'Could not get install info: The module "%s" is not installed.',
                $moduleName
            ));
        }

        return $this->installInfos[$moduleName];
    }
382785
public function getNumericID($moduleName, array $params)
    {
        $entityID = $this->getID($moduleName, $params);
        $entityIDParts = explode('x', $entityID, 2);
        return (is_array($entityIDParts) && count($entityIDParts) === 2)
            ? intval($entityIDParts[ 1 ])
            : -1;
    }
469475
public function disable($moduleName)
    {
        $module = $this->findOrFalse('module_name', $moduleName);
        if ($module)
        {
            if ($module->module_status)
            {
                $module->module_status = 0;
                $module->save();
                $this->app['events']->fire('modules.disable.'.$moduleName, null);
                return true;
            }
            return false;
        }
        return false;
    }
1045370
public function getModuleById($moduleId)
    {
        foreach ($this->getModules() as $module) {
            if ($module->getModuleId() == $moduleId) {
                return $module;
            }
        }

        return null;
    }
33449
protected function getCSVModuleAttr(string $moduleName) : array
    {
        if (empty($this->modules[$moduleName])) {
            return [];
        }

        return $this->modules[$moduleName];
    }
2943
public function getModulesAndVersions($moduleName = null)
    {
        $tmpModules = [];
        $repos = $this->getComposer()->getRepositoryManager()->getLocalRepository();

        $composerFile = $_SERVER['DOCUMENT_ROOT'] . '/../vendor/composer/installed.json';
        $composer = (array) \Zend\Json\Json::decode(file_get_contents($composerFile));
       

        foreach ($composer as $package) {
            $packageModuleName = isset($package->extra) ? (array) $package->extra : null;
            $module = null;
            if (isset($packageModuleName['module-name'])) {
                $module = $packageModuleName['module-name'];
            }

            if ($module) {
                $tmpModules[$module] = [
                    'package' => $package->name,
                    'module' => $module,
                    'version' => $package->version,
                ];

                if ($module == $moduleName) {
                    break;
                }
            }

        }

        $userModules = $this->getUserModules();
        $exclusions = ['MelisModuleConfig', 'MelisSites'];

        foreach ($userModules as $module) {
            if (!in_array($module, $exclusions)) {
                $class = $_SERVER['DOCUMENT_ROOT'] . '/../module/' . $module . '/Module.php';
                $class = file_get_contents($class);

                $package = $module;
                $version = '1.0';

                if (preg_match_all('/@(\w+)\s+(.*)\r?\n/m', $class, $matches)) {

                    $result = array_combine($matches[1], $matches[2]);
                    $version = isset($result['version']) ? $result['version'] : '1.0';
                    $package = isset($result['module']) ? $result['module'] : $module;

                }
                $tmpModules[$package] = [
                    'package' => $package,
                    'module' => $package,
                    'version' => $version,
                ];

            }
        }


        $modules = $tmpModules;


        if (!is_null($moduleName)) {
            return isset($modules[$moduleName]) ? $modules[$moduleName] : null;
        }

        return $modules;
    }
567145
public function getModule($name)
    {
        if (!isset($this->modules[$name])) {
            throw new ModuleNotFoundException();
        }

        return $this->modules[$name];
    }
262510
public function findModuleByName(string $moduleName, PathTransfer $pathTransfer): ModuleTransfer
    {
        $moduleTransfer = $this->createModuleTransfer();
        $moduleTransfer->setModuleName($moduleName);

        $coreModulePath = $this->getCoreModulePath($moduleName, $pathTransfer);
        $projectModulePath = $this->getProjectModulePath($moduleName, $pathTransfer);

        $modulePaths = array_filter([
            $coreModulePath,
            $projectModulePath,
        ]);

        if ($modulePaths === []) {
            return $moduleTransfer;
        }

        $schemas = $this->getModuleSchemaPaths($modulePaths);

        $moduleTransfer->setModulePaths($modulePaths);
        $moduleTransfer->setSchemaPaths($schemas);

        return $moduleTransfer;
    }
1053857
public function get($key)
    {
        if ( ! $this->has($key)) {
            return false;
        }

        return $this->modules->get($key);
    }
194439
public function listByModuleName($moduleName)
    {
        if ($this->primaryKeysSorted) {
            $this->lazySortPrimaryKeys();
        }

        return $this->map->listBySecondaryKey($moduleName);
    }