Retrieves shop configuration parameters from DB.

@param string $varName Variable name
@param string $shopId  Shop ID
@param string $module  module identifier

@return object - raw configuration value in DB
15535
public function getShopConfVar($varName, $shopId = null, $module = '')
    {
        if (!$shopId) {
            $shopId = $this->getShopId();
        }

        if ($shopId == $this->getShopId() && (!$module || $module == Config::OXMODULE_THEME_PREFIX . $this->getConfigParam('sTheme'))) {
            $varValue = $this->getConfigParam($varName);
            if ($varValue !== null) {
                return $varValue;
            }
        }

        $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);

        $query = "select oxvartype, " . $this->getDecodeValueQuery() . " as oxvarvalue from oxconfig where oxshopid = '{$shopId}' and oxmodule = '{$module}' and oxvarname = " . $db->quote($varName);
        $rs = $db->select($query);

        if ($rs != false && $rs->count() > 0) {
            return $this->decodeValue($rs->fields['oxvartype'], $rs->fields['oxvarvalue']);
        }
    }
1225839
public static function param($param,$moduleName=''){
		if($moduleName){
			//echo $moduleName;exit;
			return Yii::$app->getModule($moduleName)->params[$param];
		}else{
			return Yii::$app->controller->module->params[$param];
		
		}
	}
1369989
public function ltiParameter($varname, $default=false) {
        $row = $this->session_get('lti', false);
        if ( ! $row ) return $default;
        if ( ! array_key_exists($varname, $row) ) return $default;
        return $row[$varname];
    }
735171
private static function get_all_licenses( $module_id = null ) {
            $licenses = self::get_account_option( 'all_licenses' );

            if ( ! is_array( $licenses ) ) {
                $licenses = array();
            }

            if ( is_null( $module_id ) ) {
                return $licenses;
            }

            $licenses = isset( $licenses[ $module_id ] ) ?
                $licenses[ $module_id ] :
                array();

            return $licenses;
        }
80896
protected function &GetModuleConfig()
    {
        if (is_null($this->oModuleConfig)) {
            $this->oModuleConfig = TdbShopSystemInfoModuleConfig::GetNewInstance();
            if (!$this->oModuleConfig->LoadFromField('cms_tpl_module_instance_id', $this->instanceID)) {
                $this->oModuleConfig = null;
            }
        }

        return $this->oModuleConfig;
    }
131910
public Config getTweakedConfig(Config config, String dbModuleName)
    {
        return Config.getOverriddenConfig(config,
                new MapConfiguration(getConfigurationTweak(dbModuleName)));
    }
168938
public function getCouponput($shop_id)
    {
        $url = 'https://api.weixin.qq.com/bizwifi/couponput/get?access_token=ACCESS_TOKEN';
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['shop_id' => $shop_id]);
    }
455110
public static PmiModuleConfig findConfig(PmiModuleConfig[] configs, String moduleID) {
        if (moduleID == null)
            return null;

        for (int i = 0; i < configs.length; i++) {
            if (configs[i].getUID().equals(moduleID)) // VELA
                //configs[i].getShortName().equals(moduleID))
                return configs[i];
        }
        return null;
    }
256833
private function getDataFromOxConfigTable(string $name, string $moduleId, int $shopId): array
    {
        $queryBuilder = $this->queryBuilderFactory->create();
        $queryBuilder
            ->select('decode(oxvarvalue, :key) as value, oxvartype as type, oxvarname as name')
            ->from('oxconfig')
            ->where('oxshopid = :shopId')
            ->where('oxmodule = :moduleId')
            ->andWhere('oxvarname = :name')
            ->setParameters([
                'shopId'    => $shopId,
                'moduleId'  => $moduleId,
                'name'      => $name,
                'key'       => $this->context->getConfigurationEncryptionKey(),
            ]);

        $result = $queryBuilder->execute()->fetch();

        if (false === $result) {
            throw new EntryDoesNotExistDaoException();
        }

        return $result;
    }
491332
protected function _addModuleSettings($moduleSettings, $moduleId)
    {
        $config = $this->getConfig();
        $shopId = $config->getShopId();
        if (is_array($moduleSettings)) {
            foreach ($moduleSettings as $setting) {

                $module = $this->getModuleConfigId($moduleId);
                $name = $setting["name"];
                $type = $setting["type"];

                $value = is_null($config->getConfigParam($name)) ? $setting["value"] : $config->getConfigParam($name);

                $changed = $config->saveShopConfVar($type, $name, $value, $shopId, $module);
                if ($changed) {
                    $this->output->writeln("$moduleId: setting for '$name' fixed'");
                    $this->needCacheClear = $this->needCacheClear || $changed;
                }
            }
        }
    }
692228
public function widgetToValue($varValue, $itemId)
    {
        if (null === $varValue) {
            return null;
        }
        static $cache = [];
        $attributeId = $this->get('id');
        if (array_key_exists($attributeId, $cache) && array_key_exists($varValue, $cache[$attributeId])) {
            return $cache[$attributeId][$varValue];
        }

        $model = $this->getSelectMetaModel();
        $alias = $this->getIdColumn();

        if ($model->hasAttribute($alias)) {
            $attribute = $model->getAttribute($alias);
            // It is an attribute, we may search for it.
            $ids = $attribute->searchFor($varValue);
        } else {
            // Must be a system column then.
            $result = $this->connection->createQueryBuilder()
                ->select('v.id')
                ->from($this->getSelectSource(), 'v')
                ->where('v.' . $this->getIdColumn() . '=:value')
                ->setParameter('value', $varValue)
                ->execute();

            $ids = $result->fetchAll(\PDO::FETCH_COLUMN);
        }

        // Maybe deleted value?
        if ([] === $ids) {
            return $cache[$attributeId][$varValue] = null;
        }

        // Multiple results.
        if (null === $ids || \count($ids) > 1) {
            throw new \RuntimeException(
                \sprintf(
                    'Multiple values found for %s, are there obsolete values for %s.%s (att_id: %s)?',
                    \var_export($varValue, true),
                    $model->getTableName(),
                    $this->getColName(),
                    $this->get('id')
                )
            );
        }
        $valueId = \array_shift($ids);

        $value = $this->getValuesById(
            [$valueId],
            [$this->getAliasColumn(), $this->getValueColumn(), $this->getIdColumn(), $this->getSortingColumn()]
        );

        return $cache[$attributeId][$varValue] = $value[$valueId];
    }
830612
public function getOpinions($shopId, $params = array())
    {
        $resource = 'shop/' . $shopId . '/opinion.json';
        $resource .= '?' . $this->buildQueryString($params);
        $response = $this->getServiceResponse($resource);

        $shopOpinions = new Models\ResponseShopOpinionsGet($response);

        return $shopOpinions;
    }
203420
protected function _getLoginQuery($userName, $password, $shopId, $isAdmin)
    {
        $database = DatabaseProvider::getDb();
        $userNameCondition = $this->formQueryPartForUserName($userName, $database);
        $shopOrRightsCondition = $this->formQueryPartForAdminView($shopId, $isAdmin);
        $passwordCondition = $this->formQueryPartForSha512Password($password, $database, $userNameCondition, $shopOrRightsCondition);
        $userActiveCondition = $this->formQueryPartForActiveUser();


        $query = "SELECT `oxid`
                    FROM oxuser 
                    WHERE 1  
                    AND $userActiveCondition 
                    AND $passwordCondition 
                    AND $userNameCondition 
                    $shopOrRightsCondition
                    ";

        return $query;
    }
250731
public function getmodule($id){
		if(!$db=BFactory::getDBO()){
			return false;
			}
		$qr='SELECT * from `soft_modules_rules` where id='.$id;
		$q=$db->Query($qr);
		if(empty($q)){
			return $modules;
			}
		while($l=$db->fetch($q)){
			$id=(int)$l['id'];
			$module=new BSoftModule();
			$module->load($l);
			}
		return $module;
		}
472725
public static int getDataId(String moduleName, String dataName) {
        PmiModuleConfig config = PerfModules.getConfig(moduleName);
        // attach module name to it - this has to be consistent with the PMI xml config files
        // under com/ibm/websphere/pmi/xxModule.xml
        if (dataName.indexOf('.') < 0)
            dataName = moduleName + "." + dataName;
        if (config != null)
            return config.getDataId(dataName);
        else
            return -1;
    }
526636
private function getVariantValueList(TdbShopVariantType $variantType)
    {
        $dbConnection = $this->getDatabaseConnection();

        /**
         * @var array $selectedVariantTypeValues
         */
        $selectedVariantTypeValues = $this->getInputFilterUtil()->getFilteredInput('variantTypeValues');

        if (false === is_array($selectedVariantTypeValues) || false === array_key_exists($variantType->id, $selectedVariantTypeValues)) {
            return $variantType->GetFieldShopVariantTypeValueList();
        }

        $selectedVariantValues = $selectedVariantTypeValues[$variantType->id];

        $query = 'SELECT * 
                            FROM `shop_variant_type_value`
                           WHERE `shop_variant_type_value`.`id` IN (%s) 
                        ORDER BY %s ASC 
                            ';

        $escapedSelectedVariantValues = implode(',', array_map(array($dbConnection, 'quote'), $selectedVariantValues));
        $escapedFieldName = $dbConnection->quoteIdentifier($variantType->fieldShopVariantTypeValueCmsfieldname);
        $query = sprintf($query, $escapedSelectedVariantValues, $escapedFieldName);

        return TdbShopVariantTypeValueList::GetList($query);
    }
74397
public function module(Module $module)
    {
        $vars = $this->model::generate_page($module, 'setting');
        
        return $this->makeResponse('module', $vars);
    }