register the active variant for an article with a spot - this allow us to later refresh all
data for that spot without loosing the currentl selected variant info.

@param string $sSpotName
@param string $sParentId
@param string $sShopVariantArticleId
164698
public static function RegisterActiveVariantForSpot($sSpotName, $sParentId, $sShopVariantArticleId)
    {
        if (!array_key_exists(TdbShop::SESSION_ACTIVE_VARIANT_ARRAY, $_SESSION)) {
            $_SESSION[TdbShop::SESSION_ACTIVE_VARIANT_ARRAY] = array();
        }
        if (!array_key_exists($sSpotName, $_SESSION[TdbShop::SESSION_ACTIVE_VARIANT_ARRAY])) {
            $_SESSION[TdbShop::SESSION_ACTIVE_VARIANT_ARRAY][$sSpotName] = array();
        }
        $_SESSION[TdbShop::SESSION_ACTIVE_VARIANT_ARRAY][$sSpotName][$sParentId] = $sShopVariantArticleId;
    }
1099947
public void spare_spare_serviceInfos_PUT(String spare, OvhService body) throws IOException {
		String qPath = "/xdsl/spare/{spare}/serviceInfos";
		StringBuilder sb = path(qPath, spare);
		exec(qPath, "PUT", sb.toString(), body);
	}
124946
void registerId(final WComponent component) {
		if (!WebUtilities.isActiveNamingContext(this)) {
			throw new SystemException("Can only register a component on an active NamingContext");
		}

		// Get registered id names
		ComponentModel model = getOrCreateComponentModel();
		Map<String, WComponent> ids = model.getContextIds();
		if (ids == null) {
			ids = new HashMap<>();
			model.setContextIds(ids);
		}

		// Get id name
		String idName = component.getIdName();

		// Check if already used
		WComponent mapped = ids.get(idName);

		// Not in map
		if (mapped == null) {
			// Save ID / Component
			ids.put(idName, component);
		} else if (mapped != component) { // Check is same component
			String contextName = getId();
			throw new SystemException("Duplicate ID. ID \"" + idName + "\" for " + component.
					getClass().getName()
					+ " is already in use by " + mapped.getClass().getName() + " in context \"" + contextName + "\".");
		}

	}
699699
public function savevariant($sOXID = null, $aParams = null)
    {
        if (!isset($sOXID) && !isset($aParams)) {
            $sOXID = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("voxid");
            $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
        }

        // varianthandling
        $soxparentId = $this->getEditObjectId();
        if (isset($soxparentId) && $soxparentId && $soxparentId != "-1") {
            $aParams['oxarticles__oxparentid'] = $soxparentId;
        } else {
            unset($aParams['oxarticles__oxparentid']);
        }
        /** @var \OxidEsales\Eshop\Application\Model\Article $oArticle */
        $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);

        if ($sOXID != "-1") {
            $oArticle->loadInLang($this->_iEditLang, $sOXID);
        }

        // checkbox handling
        if (is_array($aParams) && !isset($aParams['oxarticles__oxactive'])) {
            $aParams['oxarticles__oxactive'] = 0;
        }

        if (!$this->_isAnythingChanged($oArticle, $aParams)) {
            return;
        }

        $oArticle->setLanguage(0);
        $oArticle->assign($aParams);
        $oArticle->setLanguage($this->_iEditLang);

        // #0004473
        $oArticle->resetRemindStatus();

        if ($sOXID == "-1") {
            if ($oParent = $this->_getProductParent($oArticle->oxarticles__oxparentid->value)) {
                // assign field from parent for new variant
                // #4406
                $oArticle->oxarticles__oxisconfigurable = new \OxidEsales\Eshop\Core\Field($oParent->oxarticles__oxisconfigurable->value);
                $oArticle->oxarticles__oxremindactive = new \OxidEsales\Eshop\Core\Field($oParent->oxarticles__oxremindactive->value);
            }
        }

        $oArticle->save();
    }
728676
public void setUploadVariant(String uploadVariant) {

        UploadVariant upload = null;
        try {
            upload = UploadVariant.valueOf(uploadVariant);
        } catch (Exception e) {
            // may happen, set default
            if (upload == null) {
                upload = OpenCms.getWorkplaceManager().getDefaultUserSettings().getUploadVariant();
            }
            if (upload == null) {
                upload = UploadVariant.gwt;
            }
        }
        setUploadVariant(upload);
    }
1112436
private void joinAndPostProcessBundle(JoinableResourceBundle bundle, BundleProcessingStatus status) {

		JoinableResourceBundleContent store;
		List<Map<String, String>> allVariants = VariantUtils.getAllVariants(bundle.getVariants());
		// Add the default bundle variant (the non variant one)
		allVariants.add(null);

		for (Map<String, String> variantMap : allVariants) {
			status.setBundleVariants(variantMap);
			String variantKey = VariantUtils.getVariantKey(variantMap);
			String name = VariantUtils.getVariantBundleName(bundle.getId(), variantKey, false);
			store = joinAndPostprocessBundle(bundle, variantMap, status);
			storeBundle(name, store);
			initBundleDataHashcode(bundle, store, variantKey);
		}
	}
590496
public void addPostProcessVariant(String variantType, VariantSet variantSet) {

		Map<String, VariantSet> variantMap = new HashMap<>();
		variantMap.put(variantType, variantSet);
		addPostProcessVariant(variantMap);
	}
1219283
public function save($sString, $sPath, $iWidth = null, $iHeight = null)
    {
        $rImg = $this->generateBarcode($sString, $iWidth, $iHeight);

        if ($rImg) {

            imagepng($rImg, $sPath);
            imagedestroy($rImg);

            return true;

        } else {

            return false;
        }
    }
1288422
protected function assertUniqueStepName($stepName)
    {
        if (isset($this->steps[$stepName])) {
            throw new StepAlreadyRegisteredException(
                sprintf('Step %s is already registered in scenario %s.', $stepName, get_class($this->scenario))
            );
        }
    }
62311
public void registerVariantResolver(VariantResolver resolver) {

		for (VariantResolver variantResolver : variantResolvers.values()) {
			if (StringUtils.isEmpty(resolver.getVariantType())) {
				throw new IllegalStateException(
						"The getVariantType() method must return something at " + resolver.getClass());
			}

			if (resolver.getVariantType().equals(variantResolver.getVariantType())) {
				throw new IllegalStateException("There are 2 resolvers defined for the variant type '"
						+ resolver.getVariantType() + "' : " + variantResolver.getClass() + ";" + resolver.getClass());
			}
		}
		variantResolvers.put(resolver.getVariantType(), resolver);
	}
933219
public void setActiveProfile(long identifier, boolean fireOnProfileChanged) {
        if (mAccountHeaderBuilder.mProfiles != null) {
            for (IProfile profile : mAccountHeaderBuilder.mProfiles) {
                if (profile != null) {
                    if (profile.getIdentifier() == identifier) {
                        setActiveProfile(profile, fireOnProfileChanged);
                        return;
                    }
                }
            }
        }
    }
42984
public void serviceName_cdn_serviceInfosUpdate_POST(String serviceName, OvhRenewType renew) throws IOException {
		String qPath = "/hosting/web/{serviceName}/cdn/serviceInfosUpdate";
		StringBuilder sb = path(qPath, serviceName);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "renew", renew);
		exec(qPath, "POST", sb.toString(), o);
	}
1036689
public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
    {
        if ($initChildSequence || !isset($compiler->_cache['inheritanceInit'])) {
            $compiler->registerPostCompileCallback(array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'),
                                                   array($initChildSequence), 'inheritanceInit', $initChildSequence);

            $compiler->_cache['inheritanceInit'] = true;
        }
    }
7416
public function Render($sSpotName = null, $aCallTimeVars = array())
    {
        $oUser = TdbDataExtranetUser::GetInstance();
        if (!is_null($oUser->fieldName) && !$oUser->IsLoggedIn()) {
            $this->SetLastUserBoughtToSession($oUser);
        }
        $sHTML = parent::Render($sSpotName, $aCallTimeVars);
        TdbShopOrderStep::ResetMarkOrderProcessAsCompleted();
        // if the user is not logged in, we need to clear the user object

        if (empty($oUser->id) || false == $oUser->IsLoggedIn()) {
            $tmp = $oUser->GetInstance(true);
        }

        return $sHTML;
    }
178490
protected void register(Class<? extends NlsBundle> bundleInterface, NlsBundle bundle) {

    NlsBundle old = this.bundleMap.put(bundleInterface, bundle);
    if (old != null) {
      throw new IllegalStateException("Duplicate bundle for " + bundleInterface);
    }
  }
1045414
public function registerVariable($var_id, CodeLocation $location, $branch_point)
    {
        $this->all_vars[$var_id] = $location;

        if ($branch_point) {
            $this->var_branch_points[$var_id] = $branch_point;
        }

        $this->registerVariableAssignment($var_id, $location);
    }
368523
public function loadAttributes($sArticleId, $sParentId = null)
    {
        if ($sArticleId) {
            $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);

            $sAttrViewName = getViewName('oxattribute');
            $sViewName = getViewName('oxobject2attribute');

            $sSelect = "select {$sAttrViewName}.`oxid`, {$sAttrViewName}.`oxtitle`, o2a.`oxvalue` from {$sViewName} as o2a ";
            $sSelect .= "left join {$sAttrViewName} on {$sAttrViewName}.oxid = o2a.oxattrid ";
            $sSelect .= "where o2a.oxobjectid = '%s' and o2a.oxvalue != '' ";
            $sSelect .= "order by o2a.oxpos, {$sAttrViewName}.oxpos";

            $aAttributes = $oDb->getAll(sprintf($sSelect, $sArticleId));

            if ($sParentId) {
                $aParentAttributes = $oDb->getAll(sprintf($sSelect, $sParentId));
                $aAttributes = $this->_mergeAttributes($aAttributes, $aParentAttributes);
            }

            $this->assignArray($aAttributes);
        }
    }