Encodes vendor category URLs into SEO format.

@param \OxidEsales\Eshop\Application\Model\Vendor $vendor     Vendor object
@param int                                        $languageId Language id

@return null
513483
public function getVendorUrl($vendor, $languageId = null)
    {
        if (!isset($languageId)) {
            $languageId = $vendor->getLanguage();
        }

        return $this->_getFullUrl($this->getVendorUri($vendor, $languageId), $languageId);
    }
1203453
public function getStoreIdFromLangcode($langcode = '') {
    if (empty($langcode)) {
      $langcode = $this->languageManager->getCurrentLanguage()->getId();
    }
    $mapping = $this->getStoreLanguageMapping();
    return !empty($mapping[$langcode]) ? $mapping[$langcode] : NULL;
  }
777745
public function actionAddImages(int $categoryId, int $languageId)
    {
        $this->trigger(self::EVENT_BEFORE_EDIT_CATEGORY);

        $category = Category::findOne($categoryId);
        $image_form = new CategoryImageForm();

        if (Yii::$app->request->isPost) {
            $image_form->cover = UploadedFile::getInstance($image_form, 'cover');
            $image_form->thumbnail = UploadedFile::getInstance($image_form, 'thumbnail');
            $image_form->menu_item = UploadedFile::getInstance($image_form, 'menu_item');

            if (!empty($image_form->cover) || !empty($image_form->thumbnail) || !empty($image_form->menu_item)) {
                $image_name = $image_form->upload();

                if (!empty($image_form->cover)) {
                    $category->cover = $image_name['cover'];
                }
                if (!empty($image_form->thumbnail)) {
                    $category->thumbnail = $image_name['thumbnail'];
                }
                if (!empty($image_form->menu_item)) {
                    $category->menu_item = $image_name['menu_item'];
                }
            }
            if ($category->validate()) {
                $category->save();
                $this->trigger(self::EVENT_AFTER_EDIT_CATEGORY, new CategoryEvent(['id' => $categoryId]));
                Yii::$app->getSession()->setFlash('success', 'The images have successfully uploaded.');
            } else Yii::$app->getSession()->setFlash('error', 'Error loading image.');
        }

        return $this->render('save', [
            'viewName' => 'add-images',
            'params' => [
                'languages' => Language::findAll(['active' => true]),
                'category' => $category,
                'image_form' => $image_form,
                'selectedLanguage' => Language::findOne($languageId),
            ],
        ]);
    }
752161
public function findPackageByName($vendor, $packageName = '')
    {
        if ($packageName === '') {
            if (strpos($vendor, '/') === false) {
                throw new Exception('Invalid package name');
            }
            list($vendor, $packageName) = explode('/', $vendor);
        }

        return $this->makeRequest("/packages/{$vendor}/{$packageName}.json");
    }
418
protected function _generateVendorDir($sVendor)
    {
        $sVendorDir = $this->_sModuleDir . $sVendor . DIRECTORY_SEPARATOR;
        if (!file_exists($sVendorDir)) {
            mkdir($sVendorDir);

            // Generate vendor metadata file
            file_put_contents($sVendorDir . 'vendormetadata.php', '<?php');
        }
    }
1009496
public function actionAddCombination(int $productId, int $languageId)
    {
        $combination = new Combination();
        $combinationTranslation = new CombinationTranslation();
        $combinationsList = Combination::find()
            ->with([
                'images',
                'prices',
                'combinationAttributes.productAttribute',
                'combinationAttributes.productAttribute.translation',
                'combinationAttributes.productAttributeValue',
                'combinationAttributes.productAttributeValue.translation',
                'combinationAvailability',
                'combinationAvailability.translation',
            ])
            ->where(['product_id' => $productId])
            ->all();

        $imageForm = new CombinationImageForm();
        $productImages = ProductImage::find()->where(['product_id' => $productId])->all();

        $combinationAttributeForm = new CombinationAttributeForm();
        $combinationAttribute = new CombinationAttribute();

        $userGroups = UserGroup::find()->all();

        $prices = [];
        foreach ($userGroups as $userGroup) {
            $price = new Price();
            $prices[$userGroup->id] = $price;
        }

        if (\Yii::$app->request->isPost) {

            $post = \Yii::$app->request->post();
            if ($combination->load($post)) {
                $combination->product_id = $productId;

                $combination->setDefaultOrNotDefault();
                if ($combination->validate()) $combination->save();

                if ($combinationTranslation->load($post)) {
                    $combinationTranslation->combination_id = $combination->id;
                    $combinationTranslation->language_id = $languageId;
                    if ($combinationTranslation->validate()) $combinationTranslation->save();
                }

                if (Model::loadMultiple($prices, Yii::$app->request->post()) && Model::validateMultiple($prices)) {
                    foreach ($prices as $key => $price) {
                        $price->save(false);
                        $combinationPrice = new CombinationPrice();
                        $combinationPrice->combination_id = $combination->id;
                        $combinationPrice->price_id = $price->id;
                        $combinationPrice->user_group_id = $key;
                        if ($combinationPrice->validate()) $combinationPrice->save();
                    }
                }

                $this->loadCombinationAttributeForm($combination, $post, $combinationAttributeForm, $combinationAttribute);
                $this->saveCombinationImages($imageForm, $post, null, $combination);

                $eventName = self::EVENT_AFTER_EDIT_PRODUCT;
                $this->trigger($eventName, new ProductEvent([
                    'id' => $combination->product_id
                ]));

                $this->redirect(['add-combination',
                    'productId' => $productId,
                    'languageId' => $languageId
                ]);
            }
        }

        return $this->render('../product/save', array(
            'viewName' => '../combination/add-combination',
            'selectedLanguage' => Language::findOne($languageId),
            'product' => Product::findOne($productId),
            'languages' => Language::find()->all(),

            'params' => array(
                'combination' => $combination,
                'combinationTranslation' => $combinationTranslation,
                'combinations' => $combinationsList,
                'product' => Product::findOne($productId),
                'productImages' => $productImages,
                'image_form' => $imageForm,
                'languageId' => $languageId,
                'combinationAttribute' => $combinationAttribute,
                'combinationAttributeForm' => $combinationAttributeForm,
                'prices' => $prices,
            )
        ));
    }
1138464
public function getPageByUid(int $uid, int $languageUid = null) {
    return $this->getPage($uid, $languageUid);
  }
1048727
public function loadLanguageById($languageId)
    {
        $language = $this->languageHandler->load($languageId);

        return $this->buildDomainObject($language);
    }
1243213
private function disableVendor($vendorData)
    {

        $vendor = $this->vendorManager->findByMiraklId($vendorData['shop_id']);
        $logVendor = $this->logVendorManager->findByMiraklId($vendorData['shop_id']);

        if ($vendor) {
            $this->logger->info(
                'Shop ' . $vendorData['shop_id'] . ' found in database',
                array('miraklId' => $vendorData['shop_id'], "action" => "Wallet creation")
            );
            if ($vendor->getEnabled() || $vendor->getEnabled() === null) {
                $vendor->setEnabled(false);
                $this->vendorManager->save($vendor);
                if ($logVendor !== null) {
                    $logVendor->setEnabled(false);
                    $this->logVendorManager->save($logVendor);
                }
                $this->logger->info(
                    'Shop ' . $vendorData['shop_id'] . ' disabled',
                    array('miraklId' => $vendorData['shop_id'], "action" => "Wallet creation")
                );
            } else {
                $this->logger->info(
                    'Shop ' . $vendorData['shop_id'] . ' already disabled',
                    array('miraklId' => $vendorData['shop_id'], "action" => "Wallet creation")
                );
            }
        }
    }
730061
public function getByLangOrFirst($key, $languageId)
    {
        $templateId = EmailTemplate::getIdByKey($key);

        if ($template = EmailTemplateTranslation::findOne([
            'template_id' => $templateId,
            'language_id' => $languageId
        ])) {
            return Template::buildTemplate($template);
        }
        elseif ($templates = EmailTemplateTranslation::findAll([
            'template_id' => $templateId
        ])) {
            return Template::buildTemplate($templates[0]);
        }

        return null;
    }
782845
def com_google_fonts_check_vendor_id(ttFont, registered_vendor_ids):
  """"""

  SUGGEST_MICROSOFT_VENDORLIST_WEBSITE = (
    " You should set it to your own 4 character code,"
    " and register that code with Microsoft at"
    " https://www.microsoft.com"
  "/typography/links/vendorlist.aspx")

  vid = ttFont['OS/2'].achVendID
  bad_vids = ['UKWN', 'ukwn', 'PfEd']
  if vid is None:
    yield WARN, Message("not set", "OS/2 VendorID is not set." +
                                   SUGGEST_MICROSOFT_VENDORLIST_WEBSITE)
  elif vid in bad_vids:
    yield WARN, Message("bad", ("OS/2 VendorID is '{}',"
                                " a font editor default.").format(vid) +
                                SUGGEST_MICROSOFT_VENDORLIST_WEBSITE)
  elif vid not in registered_vendor_ids.keys():
    yield WARN, Message("unknown", ("OS/2 VendorID value '{}' is not"
                                    " a known registered id.").format(vid) +
                                    SUGGEST_MICROSOFT_VENDORLIST_WEBSITE)
  else:
    yield PASS, f"OS/2 VendorID '{vid}' looks good!"
300697
private function findComposerDirectory($vendor, $file = '')
    {
        $composerDirectory = $this->normalizePath($vendor . '/composer/' . $file);

        if ($this->files->exists($composerDirectory)) {
            return $composerDirectory;
        }

        return false;
    }
1129923
private function getShopOrderStepList($languageId)
    {
        $query = 'SELECT * FROM `shop_order_step` ORDER BY `position`';
        $statement = $this->databaseConnection->prepare($query);
        $statement->execute();
        $steps = array();
        while ($row = $statement->fetch()) {
            $step = new TdbShopOrderStep();
            $step->SetLanguage($languageId);
            $step->LoadFromRow($row);
            $steps[] = $step;
        }

        return $steps;
    }
1255658
public function getLicenseContent($languageId)
    {
        $licensePathElements = [
            $this->getSetupDirectory(),
            ucfirst($languageId),
            self::LICENSE_TEXT_FILENAME
        ];
        $licensePath = implode(DIRECTORY_SEPARATOR, $licensePathElements);

        $licenseContent = $this->getFileContents($licensePath);

        return $licenseContent;
    }
731989
public function findTranslated($category, $languageId)
    {
        return CategoryTranslation::whereCategoryId($category->id)
            ->whereLanguageId($languageId)
            ->first();
    }
1252004
public function findByPageIdAndByLanguageId($pageId, $languageId)
    {
        try {
            $this->initializeSearch($pageId, $languageId);
            $pageQuery = $this->queryBuilder->buildPageQuery($pageId);
            $response = $this->search->search($pageQuery, 0, 10000);
        } catch (NoSolrConnectionFoundException $exception) {
            return [];
        } catch (SolrCommunicationException $exception) {
            return [];
        }
        $data = $response->getParsedData();
        return $this->documentEscapeService->applyHtmlSpecialCharsOnAllFields($data->response->docs ?? []);
    }
888125
public function lookupLocaleForLanguageId($languageId)
    {
        /** @var Model $languageModel */
        $languageModel = static::$cmsLanguageModel;

        $language = $languageModel::where('id', $languageId)
            ->remember((config('pxlcms.cache.languages', 15)))
            ->first();

        if (empty($language)) return null;

        return $this->normalizeToLocale($language->code);
    }