@param ShopModuleSetting $shopModuleSetting

@throws \Throwable
518079
public function save(ShopModuleSetting $shopModuleSetting)
    {
        $this->transactionService->begin();

        try {
            /**
             * The same entity was splitted between two tables.
             * Till we can't refactor tables we have to save data in both.
             */
            $this->deleteFromOxConfigTable($shopModuleSetting);
            $this->deleteFromOxConfigDisplayTable($shopModuleSetting);

            $this->saveDataToOxConfigTable($shopModuleSetting);
            $this->saveDataToOxConfigDisplayTable($shopModuleSetting);

            $this->transactionService->commit();
        } catch (\Throwable $throwable) {
            $this->transactionService->rollback();
            throw $throwable;
        }
    }
320446
public final function registerModule(Module $module)
    {
        $dependencies = $module->getModules();

        foreach($dependencies as $dependency){
            $this->registerModule($dependency);
        }

        $this->modules[$module->getModuleName()] = $module;
    }
886205
public function removeOperationModule(\CampaignChain\CoreBundle\Entity\OperationModule $operationModules)
    {
        $this->operationModules->removeElement($operationModules);
    }
1087919
@SuppressWarnings("PMD.UseVarargs")
    public void disableModules(final Class<? extends Module>[] modules) {
        for (Class<? extends Module> module : modules) {
            registerDisable(ConfigItem.Module, module);
        }
    }
1329217
public function validate(ModuleSetting $moduleSetting, string $moduleId, int $shopId)
    {
        if (!$this->canValidate($moduleSetting)) {
            throw new WrongModuleSettingException($moduleSetting, self::class);
        }

        $events = $moduleSetting->getValue();
        foreach ($this->validEvents as $validEventName) {
            if (is_array($events) && array_key_exists($validEventName, $events)) {
                $this->checkIfMethodIsCallable($events[$validEventName]);
            }
        }
    }
1139903
public function get(string $name, string $moduleId, int $shopId): ShopModuleSetting
    {
        /**
         * The same entity was splitted between two tables.
         * Till we can't refactor tables we have to get data from both.
         */
        $settingsData = array_merge(
            $this->getDataFromOxConfigTable($name, $moduleId, $shopId),
            $this->getDataFromOxConfigDisplayTable($name, $moduleId)
        );

        $setting = new ShopModuleSetting();
        $setting
            ->setName($name)
            ->setValue($this->shopSettingEncoder->decode($settingsData['type'], $settingsData['value']))
            ->setShopId($shopId)
            ->setModuleId($moduleId)
            ->setType($settingsData['type']);

        if (isset($settingsData['oxvarconstraint'])
            && is_string($settingsData['oxvarconstraint'])
            && $settingsData['oxvarconstraint'] !== ''
        ) {
            $setting->setConstraints(
                explode('|', $settingsData['oxvarconstraint'])
            );
        }

        if (isset($settingsData['oxgrouping'])) {
            $setting->setGroupName($settingsData['oxgrouping']);
        }

        if (isset($settingsData['oxpos'])) {
            $setting->setPositionInGroup(
                (int) $settingsData['oxpos']
            );
        }

        return $setting;
    }
573231
public function ModuleInitHook()
    {
        parent::ModuleInitHook();
        $oShop = TdbShop::GetInstance();
        if ($oShop->fieldRedirectToNotFoundPageProductSearchOnNoResults) {
            // in this case the shop may redirect after running the search. since this occurs in the Execute of the module, we need
            // to prevent any other output from being auto-sent to the browser
            TGlobal::GetController()->SetBlockAutoFlushToBrowser(true);
        }
    }
1285938
function modTryInvokeFactory(id) {
        var mod = modModules[id];

        if (mod && mod.invokeFactory) {
            mod.invokeFactory();
        }
    }
281845
public function setPaymentMode($mode)
    {

        try {
            if ($mode instanceof PagSeguroPaymentMode) {
                $this->paymentMode = $mode;
            } else {
                $this->paymentMode = new PagSeguroPaymentMode($mode);
            }
        } catch (Exception $e) {
            die($e->getMessage());
        }
    }
1107595
protected function _process()
	{
		$iface = 'MShop_Context_Item_Interface';
		if( !( $this->_additional instanceof $iface ) ) {
			throw new MW_Setup_Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) );
		}

		$this->_msg( 'Adding default plugin data', 0 );
		$this->_status( '' );


		$ds = DIRECTORY_SEPARATOR;
		$pluginManager = MShop_Plugin_Manager_Factory::createManager( $this->_additional, 'Default' );


		$filename = dirname( __FILE__ ) . $ds . 'default'.  $ds . 'data'. $ds . 'plugin.php';

		if( ( $data = include( $filename ) ) == false ) {
			throw new MW_Setup_Exception( sprintf( 'No data file "%1$s" found', $filename ) );
		}

		if( isset( $data['plugin'] ) ) {
			$this->_addPluginData( $pluginManager, $data['plugin'] );
		}
	}
396085
public function deactivate(\OxidEsales\Eshop\Core\Module\Module $module)
    {
        $result = false;
        if ($moduleId = $module->getId()) {
            $this->_callEvent('onDeactivate', $moduleId);

            $this->_addToDisabledList($moduleId);

            //removing recoverable options
            $this->_deleteBlock($moduleId);
            $this->_deleteTemplateFiles($moduleId);
            $this->_deleteModuleFiles($moduleId);
            $this->_deleteModuleEvents($moduleId);
            $this->_deleteModuleVersions($moduleId);
            $this->deleteModuleControllers($moduleId);
            $this->deleteModuleSmartyPluginDirectories($moduleId);

            $this->deactivateShopAwareServices($module);

            $this->resetCache();

            $result = true;
        }

        return $result;
    }
6631
protected function finishActionModule($result)
    {
        if ($result === true) {
            $this->redirect('', $this->text('Module has been updated'), 'success');
        }

        $message = $result ? $result : $this->text('Operation unavailable');
        $this->redirect('', $message, 'danger');
    }
421656
function processModules(item) {
  if (item.exports && !item._traced) {
    bootstrap(item, 'exports', item.filename);
    item._traced = true;
  }
  if (item.children) {
    item.children.map(processModules);
  }
}
658381
private function isActiveExtension(
        string              $classExtension,
        int                 $shopId,
        ShopConfiguration   $shopConfiguration
    ): bool {

        foreach ($shopConfiguration->getModuleConfigurations() as $moduleConfiguration) {
            if ($moduleConfiguration->hasClassExtension($classExtension)
                && $this->moduleStateService->isActive($moduleConfiguration->getId(), $shopId)
            ) {
                return true;
            }
        }

        return false;
    }
177866
public void contributeToModule() {
		final GuiceModuleAccess module = this.module.get();
		if (!this.removableBindings.isEmpty()) {
			// Ok, we are broking the Java secutiry manager.
			// But it's for having something working!
			try {
				final Field field = module.getClass().getDeclaredField("bindings"); //$NON-NLS-1$
				final boolean accessible = field.isAccessible();
				try {
					field.setAccessible(true);
					final Collection<?> hiddenBindings = (Collection<?>) field.get(module);
					hiddenBindings.removeAll(this.removableBindings);
				} finally {
					field.setAccessible(accessible);
				}
			} catch (Exception exception) {
				throw new IllegalStateException(exception);
			}
		}
		module.addAll(this.bindings);
	}
439215
private function restoreModuleInformation($module, $moduleId)
    {
        $this->_addExtensions($module);
        $metaDataVersion = $module->getMetaDataVersion();
        $metaDataVersion = $metaDataVersion == '' ? $metaDataVersion = "1.0" : $metaDataVersion; 
        if (version_compare($metaDataVersion, '2.0', '<')) {
            $this->_addModuleFiles($module->getInfo("files"), $moduleId);
        }
        $this->_addTemplateBlocks($module->getInfo("blocks"), $moduleId);
        $this->_addTemplateFiles($module->getInfo("templates"), $moduleId);
        $this->_addModuleSettings($module->getInfo("settings"), $moduleId);
        $this->_addModuleVersion($module->getInfo("version"), $moduleId);
        $this->_addModuleExtensions($module->getExtensions(), $moduleId);
        $this->_addModuleEvents($module->getInfo("events"), $moduleId);

        if (version_compare($metaDataVersion, '2.0', '>=')) {
            try {
                $this->setModuleControllers($module->getControllers(), $moduleId, $module);
            } catch (ModuleValidationException $exception) {
                print "[ERROR]: duplicate controllers:" . $exception->getMessage() ."\n";
            }
        }
    }
1065594
public function removeModuleEntity($moduleEntity)
    {
        foreach ($this->moduleEntities as $key => $moduleEntityElement) {
            if ($moduleEntityElement === $moduleEntity) {
                unset($this->moduleEntities[$key]);
                break;
            }
        }

        return $this;
    }