Get the default HTML classes for a particular type.

If the type is not defined it will use the 'default' key in the
cssClasses array, otherwise it will return an empty string.

@param  string $type
@return string
349066
protected function getDefaultClasses($type)
    {
        if (isset($this->cssClasses[$type])) {
            return $this->cssClasses[$type];
        }

        if (isset($this->cssClasses['default'])) {
            return $this->cssClasses['default'];
        }

        return '';
    }
376233
protected function getHtmlType($type)
    {
        $map = Config::getEloquentToHtmlMap();

        if (array_key_exists($type, $map)) {
            return $map[$type];
        }

        return 'text';
    }
1148398
private function getFormat(Type $type): string
    {
        return $type->hasParam(0) ? $type->getParam(0) : $this->defaultFormat;
    }
1060303
public function getClassname($type)
    {
        $types = $this->types();

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

        return static::DEFAULT_CLASSNAME;
    }
16825
public static function GetXmlTypeCodeFromType( $type )
	{
		/**
		 * @var TypeCode
		 */
		switch ( $type->getTypeCode() )
		{
			case TypeCode::Boolean:
				return XmlTypeCode::Boolean;
			case TypeCode::Int16:
				return XmlTypeCode::Short;
			case TypeCode::Int32:
				return XmlTypeCode::Int;
			case TypeCode::Int64:
				return XmlTypeCode::Long;
			case TypeCode::UInt16:
				return XmlTypeCode::UnsignedShort;
			case TypeCode::UInt32:
				return XmlTypeCode::UnsignedInt;
			case TypeCode::UInt64:
				return XmlTypeCode::UnsignedLong;
			case TypeCode::SByte:
				return XmlTypeCode::Byte;
			case TypeCode::Byte:
				return XmlTypeCode::UnsignedByte;
			case TypeCode::Single:
				return XmlTypeCode::Float;
			case TypeCode::Decimal:
				return XmlTypeCode::Decimal;
			case TypeCode::Double:
				return XmlTypeCode::Double;
			case TypeCode::Char:
			case TypeCode::String:
				return XmlTypeCode::String;
			default:
				$typeName = $type->getTypeName();
				if ($typeName == DOMXPathNavigator::$CLASSNAME )
					return XmlTypeCode::Node;
				if ($typeName == UntypedAtomic::$CLASSNAME )
					return XmlTypeCode::UntypedAtomic;
				if ($typeName == Integer::$CLASSNAME )
					return XmlTypeCode::Integer;
				if ($typeName == DateTimeValue::$CLASSNAME )
					return XmlTypeCode::DateTime;
				if ($typeName == DateValue::$CLASSNAME )
					return XmlTypeCode::Date;
				if ($typeName == TimeValue::$CLASSNAME )
					return XmlTypeCode::Time;
				if ($typeName == DurationValue::$CLASSNAME )
					return XmlTypeCode::Duration;
				if ($typeName == YearMonthDurationValue::$CLASSNAME)
					return XmlTypeCode::YearMonthDuration;
				if ($typeName == DayTimeDurationValue::$CLASSNAME )
					return XmlTypeCode::DayTimeDuration;
				if ($typeName == GYearMonthValue::$CLASSNAME )
					return XmlTypeCode::GYearMonth;
				if ($typeName == GYearValue::$CLASSNAME )
					return XmlTypeCode::GYear;
				if ($typeName == GDayValue::$CLASSNAME )
					return XmlTypeCode::GDay;
				if ($typeName == GMonthValue::$CLASSNAME )
					return XmlTypeCode::GMonth;
				if ($typeName == GMonthDayValue::$CLASSNAME )
					return XmlTypeCode::GMonthDay;
				if ($typeName == QNameValue::$CLASSNAME )
					return XmlTypeCode::QName;
				if ($typeName == AnyUriValue::$CLASSNAME )
					return XmlTypeCode::AnyUri;
				if ($typeName == HexBinaryValue::$CLASSNAME )
					return XmlTypeCode::HexBinary;
				if ($typeName == Base64BinaryValue::$CLASSNAME )
					return XmlTypeCode::Base64Binary;
				if ($typeName == IDREFSValue::$CLASSNAME )
					return XmlTypeCode::Idref;
				if ($typeName == ENTITIESValue::$CLASSNAME )
					return XmlTypeCode::Entity;
				if ($typeName == NMTOKENSValue::$CLASSNAME )
					return XmlTypeCode::NmToken;
				return XmlTypeCode::Item;
		}
	}
361206
public function getColorForType($type)
    {
        // if we don't have a type return default color
        if (!isset($this->colors[$type])) {
            return Colours::DEFAULT_;
        }

        return $this->colors[$type];
    }
1048729
private function getDefaultValue(string $type)
    {
        $value = null;
        switch ($type) {
            case 'int':
                $value = 0;
                break;
            case 'string':
                $value = '';
                break;
            case 'bool':
                $value = false;
                break;
            case 'float':
                $value = 0;
                break;
            case 'double':
                $value = 0;
                break;
        }

        return $value;
    }
1070711
private function getTypeClassInstance(string $type)
    {
        $classname = isset($this->classesMap[$type]) ? $this->classesMap[$type]['class'] : false;

        return $classname ? new $classname() : false;
    }
354454
public static function getTypeName($type)
	{
		static $ref = [];
		
		$key = static::class;
		
		if(empty($ref[$key]))
		{
			$ref[$key] = new \ReflectionClass($key);
		}
		
		foreach($ref[$key]->getConstants() as $k => $v)
		{
			if($v === $type && strpos($k, 'T_') === 0)
			{
				return $k;
			}
		}

		return static::UNKNOWN;
	}
250460
private function getTypeSuffix($type)
    {
        self::$TYP_MAPPING = array_merge(self::$TYP_COMPLEX_MAPPING, self::$TYP_SIMPLE_MAPPING);

        if ($type == '') {
            return '';
        }

        if (!isset(self::$TYP_MAPPING[$this->type])) {
            return '';
        }

        return self::$TYP_MAPPING[$this->type];
    }
260648
public function getClassForType(string $type):?string
    {
        if (isset($this->typeMap[$type])) {
            return $this->typeMap[$type];
        }

        return null;
    }
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];
    }
702219
public function getFrameType($type)
    {
        if (is_int($type)) {
            return $type;
        }
        if ($type === null) {
            $type = 'STRING';
        }
        $frametype = @constant(get_class($this) . '::' . $type);
        if ($frametype === null) {
            Daemon::log(__METHOD__ . ' : Undefined frametype "' . $type . '"');
        }
        return $frametype;
    }
1148264
public static function getCodeByType($type)
    {
        if (isset(self::$typeList[$type])) {
            return self::$typeList[$type];
        } else {
            return false;
        }
    }
1260095
protected function getTypeConfig($type)
    {
        if (is_object($type)) {
            $type = $this->getTypeName($type);
        } else if (class_exists($type)) {
            $type = $this->getTypeFromClassName($type);
        }

        if (!$this->types->containsKey($type)) {
            $this->throwInvalidTypeException($type);
        }

        return $this->types->get($type);
    }
156905
public function getCode($type = 'default')
    {
        $code = $this->exception->getCode();
        if (empty($this->exception->getCode())) {
            $code = config($this->configFile.'.codes.'.$type);
        }

        return $code;
    }
820921
public static function getFieldClass($type)
    {
        $config = b8\Config::getInstance();

        $try = '\\' . $config->get('site.namespace') . '\\Form\\Element\\' . $type;

        if (class_exists($try)) {
            return $try;
        }

        $try = '\\Octo\\Form\\Element\\' . $type;

        if (class_exists($try)) {
            return $try;
        }

        $try = '\\b8\\Form\\Element\\' . $type;

        if (class_exists($try)) {
            return $try;
        }

        return null;
    }