Get the code by type
If type = external_code we strip the 3 first characters

@param array  $codes Array of codes
@param string $type  the type (external_code, totem...)

@return string|null The code
541626
public function getCode($codes, $type)
    {
        foreach ($codes as $code) {
            if ($code->type === $type) {
                return $code->type === 'external_code' ? substr($code->value, 3) : $code->value;
            }
        }

        return;
    }
377674
public function getMessageByCode(& $code, array $data = null)
    {
        // If we do not use a reference, then that defeats the purpose of
        // making the $errorMap a static property.
        $map = &static::getErrorMap();

        // When you can't find the code, use a default one.
        if (!\array_key_exists($code, $map)) {
            $code = static::UNKNOWN;
        }

        if (\is_array($data) && count($data) > 0) {
            return \vsprintf($map[$code], $data);
        }

        return $map[$code];
    }
91273
public static function getTypeName($type)
    {
        return isset(self::$names[$type])
            ? self::$names[$type]
            : null;
    }
918195
public function getCode($type, $code='')
    {
        /** @var Fontis_Australia_Helper_Data $helper */
        $helper = Mage::helper('australia');
        $codes = array(
            'services' => array(
                'AUS_LETTER_EXPRESS_SMALL'          => $helper->__('Express Post Small Envelope'),
                'AUS_LETTER_REGULAR_LARGE'          => $helper->__('Large Letter'),
                'AUS_PARCEL_COURIER'                => $helper->__('Courier Post'),
                'AUS_PARCEL_COURIER_SATCHEL_MEDIUM' => $helper->__('Courier Post Assessed Medium Satchel'),
                'AUS_PARCEL_EXPRESS'                => $helper->__('Express Post'),
                'AUS_PARCEL_REGULAR'                => $helper->__('Parcel Post'),

                'INT_PARCEL_COR_OWN_PACKAGING'      => $helper->__('International Courier'),
                'INT_PARCEL_EXP_OWN_PACKAGING'      => $helper->__('International Express'),
                'INT_PARCEL_STD_OWN_PACKAGING'      => $helper->__('International Standard'),
                'INT_PARCEL_AIR_OWN_PACKAGING'      => $helper->__('International Economy Air'),
                'INT_PARCEL_SEA_OWN_PACKAGING'      => $helper->__('International Economy Sea'),
            ),
            'extra_cover' => array(
                'AUS_SERVICE_OPTION_SIGNATURE_ON_DELIVERY'       => $helper->__('Signature on Delivery'),
                'AUS_SERVICE_OPTION_COURIER_EXTRA_COVER_SERVICE' => $helper->__('Standard cover')
            )
        );

        if (!isset($codes[$type])) {
            return false;
        } elseif (''===$code) {
            return $codes[$type];
        }

        if (!isset($codes[$type][$code])) {
            return false;
        } else {
            return $codes[$type][$code];
        }
    }
1188498
final public function get($code = null) {

        if ( is_null($code) ) return $this->rpc_errors;

        else if ( array_key_exists($code, $this->rpc_errors) ) return $this->rpc_errors[$code];

        else if ( $code >= -32099 && $code <= -32000 ) return 'Server Error';

        else return 'Unknown Error';

    }
1308896
public function getFlashText($type)
    {
        if ($this->{$type}) {
            return $this->{$type};
        } elseif ($this->parent) {
            return $this->parent->getFlashText($type);
        }

        return $type;
    }
1011971
public static function typeDef(string $type) {
        // Check for the unsigned signifier.
        $unsigned = null;
        if ($type[0] === 'u') {
            $unsigned = true;
            $type = substr($type, 1);
        } elseif (preg_match('`(.+)\s+unsigned`i', $type, $m)) {
            $unsigned = true;
            $type = $m[1];
        }

        // Remove brackets from the type.
        $brackets = null;
        if (preg_match('`^(.*)\((.*)\)$`', $type, $m)) {
            $brackets = $m[2];
            $type = $m[1];
        }

        // Look for the type.
        $type = strtolower($type);
        if (isset(self::$types[$type])) {
            $row = self::$types[$type];
            $dbtype = $type;

            // Resolve an alias.
            if (is_string($row)) {
                $dbtype = $row;
                $row = self::$types[$row];
            }
        } else {
            return null;
        }

        // Now that we have a type row we can build a schema for it.
        $schema = [
            'type' => $row['type'],
            'dbtype' => $dbtype
        ];

        if (!empty($row['schema'])) {
            $schema += $row['schema'];
        }

        if ($row['type'] === 'integer' && $unsigned) {
            $schema['unsigned'] = true;

            if (!empty($schema['maximum'])) {
                $schema['maximum'] = $schema['maximum'] * 2 + 1;
                $schema['minimum'] = 0;
            }
        }

        if (!empty($row['length'])) {
            $schema['maxLength'] = (int)$brackets ?: 255;
        }

        if (!empty($row['precision'])) {
            $parts = array_map('trim', explode(',', $brackets));
            $schema['precision'] = (int)$parts[0];
            if (isset($parts[1])) {
                $schema['scale'] = (int)$parts[1];
            }
        }

        if (!empty($row['enum'])) {
            $enum = explode(',', $brackets);
            $schema['enum'] = array_map(function ($str) {
                return trim($str, "'\" \t\n\r\0\x0B");
            }, $enum);
        }

        return $schema;
    }
242312
public static function getType($type)
    {
        $type = strtolower($type);

        if (!isset(static::$typeMapping[$type])) {
            return $type;
        }

        return static::$typeMapping[$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;
        }
    }
35914
public function type( $codes )
	{
		if( !empty( $codes ) ) {
			$this->conditions[] = $this->filter->compare( '==', 'attribute.type', $codes );
		}

		return $this;
	}
755631
public static function getType($type)
    {
        if (!isset(static::$mappedTypeInstances[$type])) {
            if (!static::hasType($type)) {
                throw TypeException::typeDoesNotExist($type);
            }

            static::$mappedTypeInstances[$type] = new static::$mappedTypeClasses[$type]();
        }

        return static::$mappedTypeInstances[$type];
    }
924146
private static function getDecoder($type)
    {
        if ($type === true) {
            return function ($value) {
                return rawurldecode(str_replace('+', ' ', $value));
            };
        } elseif ($type == Query::RFC3986) {
            return 'rawurldecode';
        } elseif ($type == Query::RFC1738) {
            return 'urldecode';
        } else {
            return function ($str) { return $str; };
        }
    }
116780
public function getTypeClass($type)
    {
        if (isset($this->types[$type])) {
            return $this->types[$type];
        }

        if (\class_exists($type)) {
            return $type;
        }

        return null;
    }
420360
protected function getStockItems( array $codes, array $types )
	{
		$map = [];
		$manager = \Aimeos\MShop::create( $this->getContext(), 'stock' );

		$search = $manager->createSearch()->setSlice( 0, 10000 );
		$search->setConditions( $search->combine( '&&', [
			$search->compare( '==', 'stock.productcode', $codes ),
			$search->compare( '==', 'stock.type', $types )
		] ) );

		foreach( $manager->searchItems( $search ) as $item ) {
			$map[$item->getProductCode()][$item->getType()] = $item;
		}

		return $map;
	}
407284
protected function getCode($code)
    {
        if (is_array($code)) {
            return $this->getCodeArray($code);
        }

        return $this->get($code);
    }
1114030
public static function getErrText($code)
    {
        if (isset(self::$errCode[$code])) {
            return self::$errCode[$code];
        }
        return false;
    }
823824
public static function code($code = 200) : String
    {
        $messages = Datatype::multikey(self::$messages);

        if( isset($messages[$code]) )
        {
            return $messages[$code];
        }

        return false;
    }