Returns variant selection.

@return array
439210
public function getVariantSelections()
    {
        // finding parent
        $oProduct = $this->getProduct();
        $sParentIdField = 'oxarticles__oxparentid';
        if (($oParent = $this->_getParentProduct($oProduct->$sParentIdField->value))) {
            $sVarSelId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("varselid");

            return $oParent->getVariantSelections($sVarSelId, $oProduct->getId());
        }

        return $oProduct->getVariantSelections(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("varselid"));
    }
1218268
protected function _buildVariantSelectionsList($aVarSelects, $aSelections)
    {
        // creating selection lists
        foreach ($aVarSelects as $iKey => $sLabel) {
            $aVariantSelections[$iKey] = oxNew(\OxidEsales\Eshop\Application\Model\VariantSelectList::class, $sLabel, $iKey);
        }

        // building variant selections
        foreach ($aSelections as $aLineSelections) {
            foreach ($aLineSelections as $oPos => $aLine) {
                $aVariantSelections[$oPos]->addVariant($aLine['name'], $aLine['hash'], $aLine['disabled'], $aLine['active']);
            }
        }

        return $aVariantSelections;
    }
1074505
public function getAllPicksBansDivided()
    {
        $return = array(
            'radiant' => array(
                'bans' => array(),
                'picks' => array()
            ),
            'dire' => array(
                'bans' => array(),
                'picks' => array()
            )
        );
        foreach ($this->_picks_bans as $pick_ban) {
            $team = 'radiant';
            $state = 'picks';
            if ($pick_ban['team']) {
                $team = 'dire';
            }
            if (!$pick_ban['is_pick']) {
                $state = 'bans';
            }
            array_push($return[$team][$state], $pick_ban);
        }
        return $return;
    }
1229020
public static function get_all_variants() {
		return [
			'100'       => esc_html__( 'Ultra-Light 100', 'kirki' ),
			'100light'  => esc_html__( 'Ultra-Light 100', 'kirki' ),
			'100italic' => esc_html__( 'Ultra-Light 100 Italic', 'kirki' ),
			'200'       => esc_html__( 'Light 200', 'kirki' ),
			'200italic' => esc_html__( 'Light 200 Italic', 'kirki' ),
			'300'       => esc_html__( 'Book 300', 'kirki' ),
			'300italic' => esc_html__( 'Book 300 Italic', 'kirki' ),
			'400'       => esc_html__( 'Normal 400', 'kirki' ),
			'regular'   => esc_html__( 'Normal 400', 'kirki' ),
			'italic'    => esc_html__( 'Normal 400 Italic', 'kirki' ),
			'500'       => esc_html__( 'Medium 500', 'kirki' ),
			'500italic' => esc_html__( 'Medium 500 Italic', 'kirki' ),
			'600'       => esc_html__( 'Semi-Bold 600', 'kirki' ),
			'600bold'   => esc_html__( 'Semi-Bold 600', 'kirki' ),
			'600italic' => esc_html__( 'Semi-Bold 600 Italic', 'kirki' ),
			'700'       => esc_html__( 'Bold 700', 'kirki' ),
			'700italic' => esc_html__( 'Bold 700 Italic', 'kirki' ),
			'800'       => esc_html__( 'Extra-Bold 800', 'kirki' ),
			'800bold'   => esc_html__( 'Extra-Bold 800', 'kirki' ),
			'800italic' => esc_html__( 'Extra-Bold 800 Italic', 'kirki' ),
			'900'       => esc_html__( 'Ultra-Bold 900', 'kirki' ),
			'900bold'   => esc_html__( 'Ultra-Bold 900', 'kirki' ),
			'900italic' => esc_html__( 'Ultra-Bold 900 Italic', 'kirki' ),
		];
	}
82785
public function getSelect() {
        if ($this->fields && $this->fields != '*' && (!(is_string($this->fields) && '*' == $this->fields[0] && 'END) AS `__parentRelationKey`' == substr($this->fields, -29)))) {
            if (is_string($this->fields)) {
                return $this->fields;
            }
            $columns = array();
            foreach ($this->fields as $field) { // @TODO: column generation here.
                $columns[] = trim($field);
            }
            return implode(', ', $columns);
        }
        if ((is_string($this->fields) && '*' == $this->fields[0] && 'END) AS `__parentRelationKey`' == substr($this->fields, -29))){
            return implode(', ', $this->getAllColumnsForSelect()) . substr($this->fields, 1);
        } else {
            return implode(', ', $this->getAllColumnsForSelect());
        }
    }
986440
public function getDisplayNameVariantsArray(): array
    {
        $array = $this->getDisplayNameVariants();
        $assoc_array = [];
        foreach ($array as $value) {
            $assoc_array[$value] = $value;
        }
        return $assoc_array;
    }
101906
public function getPossibleVariantCombinations()
    {
        $aData = array();
        /** @var TdbShopVariantSet $variantSet */
        $aVariantTypeNames = array();
        $aExistingVariantCombinations = array();

        $variantSet = $this->oTableRow->GetFieldShopVariantSet();
        $aVariantSurcharge = array();
        $aVariantParameter = array();

        $possibleVariantsCount = 1;
        if (null === $variantSet) {
            return '';
        }

        $variantTypes = $variantSet->GetFieldShopVariantTypeList();
        while ($variantType = $variantTypes->Next()) {
            $aVariantTypeNames[] = $variantType->GetName();

            $variantValueList = $this->getVariantValueList($variantType);
            $possibleVariantsCount *= $variantValueList->Length();

            if ($possibleVariantsCount > $this->maxPossibleVariantCombinations) {
                // whoops! o.k. looks like you should build a configurator instead of variants
                return false;
            }

            $aTypeVariants = array();
            while ($oValue = $variantValueList->Next()) {
                $aTypeVariants[] = $oValue->id.'|'.$oValue->GetName();
                $dSurCharge = $oValue->sqlData['surcharge'];
                if (null === $dSurCharge) {
                    $dSurCharge = 0;
                }
                $aVariantSurcharge[$oValue->id] = $dSurCharge;
            }

            $aVariantParameter[] = $aTypeVariants;
        }

        $aVariantMatrix = $this->generateVariantCombinations($aVariantParameter);

        // get all existing variants
        $oVariantList = $this->oTableRow->GetFieldShopArticleVariantsList(array(), false);

        /**
         * @var TdbShopArticle $oVariant
         */
        while ($oVariant = $oVariantList->Next()) {
            $oVariantTypeValueList = $oVariant->GetFieldShopVariantTypeValueList();
            $aVariantValues = array();
            while ($oVariantTypeValue = $oVariantTypeValueList->Next()) {
                $aVariantValues[] = $oVariantTypeValue->id;
            }

            asort($aVariantValues);
            $sVariantValueCombination = implode('|', $aVariantValues);

            $aExistingVariantCombinations[] = $sVariantValueCombination;
        }

        $aData['oVariantSet'] = $variantSet;
        $aData['aVariantMatrix'] = $aVariantMatrix;
        $aData['aVariantTypeNames'] = $aVariantTypeNames;
        $aData['aExistingVariantCombinations'] = $aExistingVariantCombinations;
        $aData['sFieldName'] = $this->name;
        $aData['sAjaxURL'] = $this->GenerateAjaxURL();
        $aData['oArticle'] = $this->oTableRow;
        $aData['aVariantSurcharge'] = $aVariantSurcharge;

        return $this->RenderVariantDetails('vShowPossibleVariants', $aData);
    }
1022470
public function getTypes()
    {
        $options = ['select' => 'full', 'orderby' => 'name_asc', 'with_hierarchy' => true];
        $types = Ref::findCached('type,bill', 'hipanel:finance', $options);

        if (!$this->app->user->can('support')) {
            $types = $this->removeUnusedTypes($types);
        }

        return $types;
    }
355521
public function getIsoDescription()
    {
        $region = $this->getRegionName();
        $variant = $this->getVariantName();

        return $this->getIsoName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : '');
    }
465710
public function pickerOptions()
    {
        if ($this->pickerOptions === null) {
            $this->pickerOptions = $this->defaultPickerOptions();
        }

        return $this->pickerOptions;
    }
515816
protected function getSelectButtons()
    {
        $environment = $this->getEnvironment();

        $event = new GetSelectModeButtonsEvent($environment);
        $event->setButtons([]);
        $environment->getEventDispatcher()->dispatch(GetSelectModeButtonsEvent::NAME, $event);

        return $event->getButtons();
    }
484470
public function variants($withOriginal = false)
    {
        $variants = array_keys($this->config->variantConfigs());

        if ($withOriginal && ! in_array(FileHandler::ORIGINAL, $variants)) {
            array_unshift($variants, FileHandler::ORIGINAL);
        }

        return $variants;
    }
785060
public function getSelectedPlugins()
    {
        $manager = $this;

        return array_filter($this->selectedPlugins, function ($plugin) use ($manager) {
            return $manager->isAvailable($plugin);
        });
    }
549607
public function getVariantAttributes()
    {
        $variantAttributes = [];
        foreach ($this->entity->getVariantAttributes() as $attribute) {
            $variantAttributes[] = new Attribute(
                $attribute,
                $this->locale,
                $this->productLocaleManager->getFallbackLocale()
            );
        }

        return $variantAttributes;
    }
229554
public function getMdVariants()
    {
        if ($this->_oMdVariants) {
            return $this->_oMdVariants;
        }

        $oParentArticle = $this->getParentArticle();
        if ($oParentArticle) {
            $oVariants = $oParentArticle->getVariants();
        } else {
            $oVariants = $this->getVariants();
        }

        /** @var \OxidEsales\Eshop\Application\Model\VariantHandler $oVariantHandler */
        $oVariantHandler = oxNew(\OxidEsales\Eshop\Application\Model\VariantHandler::class);
        $this->_oMdVariants = $oVariantHandler->buildMdVariants($oVariants, $this->getId());

        return $this->_oMdVariants;
    }
145256
protected function getIterativeUserSelectionModeChoices()
    {
        $choices = [];

        foreach ($this->context->output['models'] as $id => $model) {
            if (in_array($id, $this->modelsDone)) continue;

            $choices[] = $id . ': ' . $model['name'];
        }

        ksort($choices);

        return $choices;
    }
1308947
public function getProductAllAttributes($variation = null)
    {
        if (null === $variation) {
            $variations = $this->productVariations()->get();
        }

        $collection = Collection::make([]);

        if (null === $variations || $variations->count() <= 0) {
            return $collection;
        }

        foreach ($variations as $variation) {
            $variationModel = self::findorfail($variation->variation_id);

            foreach ($variationModel->productVarcharAttributes as $item) {
                $collection->push($item);
            }
            foreach ($variationModel->productBooleanAttributes as $item) {
                $collection->push($item);
            }

            foreach ($variationModel->productTextAttributes as $item) {
                $collection->push($item);
            }
            foreach ($variationModel->productDecimalAttributes as $item) {
                $collection->push($item);
            }
            foreach ($variationModel->productDecimalAttributes as $item) {
                $collection->push($item);
            }
            foreach ($variationModel->productIntegerAttributes as $item) {
                $collection->push($item);
            }

            foreach ($variationModel->productDatetimeAttributes as $item) {
                $collection->push($item);
            }
        }

        return $collection;
    }