Return's the mapping for the passed price type.

@param string $priceType The price type to map

@return integer The mapped price type
@throws \Exception Is thrown, if the passed price type can't be mapped
170546
public function mapPriceType($priceType)
    {

        // query whether or not the passed price type is available
        if (isset($this->priceTypeMapping[$priceType])) {
            return $this->priceTypeMapping[$priceType];
        }

        // throw an exception, if not
        throw new \Exception(
            $this->appendExceptionSuffix(
                sprintf('Can\'t find mapping for price type %s', $priceType)
            )
        );
    }
484502
protected function getCustomType($type)
    {
        $root = $this;
        while ($cur = $root->getParent()) {
            $root = $cur;
        }
        $customTypes = $root->getSchema()->getCustomTypes();
        $type = ltrim($type, '&');

        if (isset($customTypes[$type])) {
            return $customTypes[$type];
        }

        throw new Exception("Unable to resolve '$type' to a custom type-definition.");
    }
656148
protected function _getMetaFromSeo($dataType)
    {
        $seoObjectId = $this->_getSeoObjectId();
        $baseLanguageId = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
        $shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();

        if ($seoObjectId && \OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive() &&
            ($keywords = \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->getMetaData($seoObjectId, $dataType, $shopId, $baseLanguageId))
        ) {
            return $keywords;
        }
    }
605075
public function setByType($type)
    {
        if (isset(self::$typeList[$type])) {
            $this->value = self::$typeList[$type];
        } else {
            throw new Exception("undefined index $type");
        }
    }
473363
public function setType($type)
    {
        if ($type instanceof Type) {
            $this->setIndex($type->getIndex());
            $type = $type->getName();
        }

        return $this->setParam('_type', $type);
    }
76232
protected function getTypeByCode($type)
    {
        switch ($type) {
            case self::BOOLEAN:
                return 'boolean';
            case self::INT:
                return 'int';
            case self::FLOAT:
                return 'float';
            case self::STRING:
                return 'string';
            case self::DATE:
                return 'date';
            case self::OBJECT:
                return 'object';
            case self::XML:
                return 'xml';
            case self::DATA:
                return 'data';
            case self::DATA_ARRAY:
                return 'array';

            default:
                return null;
        }
    }
1300596
public function get(string $type): array
    {
        try {
            return $this->converters[$this->resolveType($type)];
        } catch (\Throwable $t) {
            throw new InvalidTypeConverterException(
                sprintf('Invalid converter type `%s`.', $type)
            );
        }
    }
800666
protected function getFieldBindType($type)
    {
        if (preg_match('/(int|double|float|decimal|real|numeric|serial|bit)/is', $type)) {
            $bind = PDO::PARAM_INT;
        } elseif (preg_match('/bool/is', $type)) {
            $bind = PDO::PARAM_BOOL;
        } else {
            $bind = PDO::PARAM_STR;
        }
        return $bind;
    }
1187983
public function type($type)
    {
        if (is_string($type)) {
            $map = array(
                'double' => 1,
                'string' => 2,
                'object' => 3,
                'array' => 4,
                'binary' => 5,
                'undefined' => 6,
                'objectid' => 7,
                'boolean' => 8,
                'date' => 9,
                'null' => 10,
                'regex' => 11,
                'jscode' => 13,
                'symbol' => 14,
                'jscodewithscope' => 15,
                'integer32' => 16,
                'timestamp' => 17,
                'integer64' => 18,
                'maxkey' => 127,
                'minkey' => 255,
            );

            $type = isset($map[$type]) ? $map[$type] : $type;
        }

        return $this->operator('$type', $type);
    }
42070
private function getFieldClass(string $type): string
    {
        if (!array_key_exists($type, $this->fieldsMapping)) {
            throw new Exception("Field type \"{$type}\" not found in field mapping. Allowed fields are \"".implode('", "', $this->fieldsMapping).'"');
        }

        return $this->fieldsMapping[$type];
    }
1057816
public static function convertNumericType($type)
    {
        if (! isset(self::$types[$type])) {
            throw new \InvalidArgumentException('Unknown numeric read preference type: ' . $type);
        }

        return self::$types[$type];
    }
156963
public function getQuery(string $type = 'select', ...$arguments): QueryObject
    {
        $allowedTypes = [
            'select',
            'insert',
            'insertignore',
            'replace',
            'delete',
            'update',
            'criteriaonly',
        ];

        if (\in_array(strtolower($type), $allowedTypes, true) === false) {
            throw new Exception($type . ' is not a known type.', 1);
        }

        $queryArr = $this->adapterInstance->$type($this->statements, ...$arguments);

        return new QueryObject($queryArr['sql'], $queryArr['bindings'], $this->getConnection());
    }
828429
public function create($type)
    {
        $typeOptions    = $this->getOption(self::OPTION_MAPPERS);
        $typeOption     = isset($typeOptions[$type]) ? $typeOptions[$type] : $this->throwException();
        $importerString = isset($typeOption[self::OPTION_MAPPERS_IMPORTER]) ? $typeOption[self::OPTION_MAPPERS_IMPORTER] : $this->throwException();
        $importer       = $this->buildService($importerString, ImportServiceInterface::class);

        if (isset($typeOption[self::OPTION_MAPPERS_MAPPER])) {
            $mapperString = $typeOption[self::OPTION_MAPPERS_MAPPER];
            $mapper       = $this->buildService($mapperString);
        } else {
            $mapper = $this->getDefaultMapper();
        }

        $this->propagate($mapper);
        $importer->setMapper($mapper);

        return $importer;
    }
380856
protected static function dataTypeToIndexField($type)
    {
        $key = '';
        $currentLang = LanguageHelper::getCurrent();
        switch ($type) {
            case Property::DATA_TYPE_STRING :
                $key = 'str_value_' . $currentLang;
                break;
            case Property::DATA_TYPE_TEXT :
                $key = 'txt_value_' . $currentLang;
                break;
            case Property::DATA_TYPE_BOOLEAN :
            case Property::DATA_TYPE_INTEGER :
                $key = 'value_integer';
                break;
            case Property::DATA_TYPE_FLOAT :
                $key = 'value_float';
                break;
            case Property::DATA_TYPE_INVARIANT_STRING :
            case Property::DATA_TYPE_PACKED_JSON :
                $key = 'utr_text';
                break;
        }
        return $key;
    }
770335
private function retrievePriceByCurrency(array &$prices, $currencyId)
    {
        /** @var ProductPrice $price */
        foreach ($prices as $index => $price) {
            if ($currencyId === $price->getCurrency()->getId()) {
                unset($prices[$index]);

                return $price;
            }
        }

        return null;
    }
720031
protected function getPriceTypeObject()
    {
        $arValuePartList = explode('|', $this->sValue);
        $sPriceTypeCode = array_pop($arValuePartList);

        $obPriceType = PriceTypeHelper::instance()->findByCode($sPriceTypeCode);

        return $obPriceType;
    }
1080056
private function mapType($type)
    {
        switch ($type) {
            case \Imagick::IMGTYPE_BILEVEL:
                return 'BILEVEL';
            case \Imagick::IMGTYPE_GRAYSCALE:
                return 'GRAYSCALE';
            case \Imagick::IMGTYPE_GRAYSCALEMATTE:
                return 'GRAYSCALEMATTE';
            case \Imagick::IMGTYPE_PALETTE:
                return 'PALETTE';
            case \Imagick::IMGTYPE_PALETTEMATTE:
                return 'PALETTEMATTE';
            case \Imagick::IMGTYPE_TRUECOLOR:
                return 'TRUECOLOR';
            case \Imagick::IMGTYPE_TRUECOLORMATTE:
                return 'TRUECOLORMATTE';
            case \Imagick::IMGTYPE_COLORSEPARATION:
                return 'COLORSEPARATION';
            case \Imagick::IMGTYPE_COLORSEPARATIONMATTE:
                return 'COLORSEPARATIONMATTE';
            case \Imagick::IMGTYPE_OPTIMIZE:
                return 'OPTIMIZE';
            case \Imagick::IMGTYPE_UNDEFINED:
            default:
                return null;
        }
    }