GetType
@param Type $type1
@param Type $type2
@return string
437537
public static function GetType( $type1, $type2 )
	{
		if ( is_subclass_of( $type1->getFullName(), ValueProxy::$dynamicValueType->getFullName() ) ||
			 is_subclass_of( $type2->getFullName(), ValueProxy::$dynamicValueType->getFullName() ) )
			return ValueProxy::$dynamicValueType;

		/**
		 * @var ValueProxyFactory $factory1
		 */
		$factory1 = isset( ValueProxy::$valueFactory[ $type1->getFullName() ] )
			? ValueProxy::$valueFactory[ $type->getFullName() ]
			: null;

		/**
		 * @var ValueProxyFactory $factory2
		 */
		$factory2 = isset( ValueProxy::$valueFactory[ $type2->getFullName() ] )
			? ValueProxy::$valueFactory[ $type->getFullName() ]
			: null;

		if ( is_null( $factory1 ) || is_null( $factory1 ) ) return Types::$ObjectType;

		switch ( ValueProxy::$conv_t[ $factory1->GetValueCode() ][ $factory2->GetValueCode() ] )
		{
			case -1:
				return $factory2->GetResultType();

			case 0:
			case 1:
				return $factory1->GetResultType();

			default:
				return Types::$ObjectType;
		}
	}
1167186
public static function getPhpType($type)
    {
        switch ($type) {
            case self::TYPE_DOUBLE:
            case self::TYPE_FLOAT:
                return 'float';
            case self::TYPE_INT64:
            case self::TYPE_UINT64:
            case self::TYPE_INT32:
            case self::TYPE_FIXED64:
            case self::TYPE_FIXED32:
            case self::TYPE_UINT32:
            case self::TYPE_SFIXED32:
            case self::TYPE_SFIXED64:
            case self::TYPE_SINT32:
            case self::TYPE_SINT64:
                return 'int';
            case self::TYPE_BOOL:
                return 'bool';
            case self::TYPE_STRING:
                return 'string';
            case self::TYPE_BYTES:
                return '\Protobuf\Stream';
            default:
                return null;
        }
    }
455219
function getType()
    {
        if($this->_type) {
            return $this->_type;
        }
        else {
            $myclass = get_class($this);
            return strtolower(substr($myclass, strrpos($myclass, '\\') + 1, -5));
        }
    }
1148264
public static function getCodeByType($type)
    {
        if (isset(self::$typeList[$type])) {
            return self::$typeList[$type];
        } else {
            return false;
        }
    }
147837
protected function getTypesSorted()
    {
        $types = $this->getTypes();
        usort($types, function ($first, $second) {
            /* @var Type $first */
            /* @var Type $second */
            return $first->name == 'mixed' ? 1 : 0;
        });

        return $types;
    }
563591
public static function getTypeDescription(?string $type): ?string
    {
        $descriptions = self::typeDescriptions();
        if (isset($descriptions[$type])) {
            return $descriptions[$type];
        }

        return $type;
    }
999875
public function getNavTypes($type, $types)
    {
        if ($type === null) {
            return $types;
        }

        return $this->filterTypes($types, $this->getTypeCategory($type));
    }
123802
public function getType() : int
    {
        $query = 'SELECT type_id FROM info LIMIT 1';

        $typeId = Type::UNKNOWN;
        foreach ($this->getAdapter()->query($query) as $row) {
            $typeId = (int)$row['type_id'];
        }

        return $typeId;
    }
15969
public function get($typeId)
    {
        if (!isset($this->types[$typeId])) {
            throw new InvalidArgumentException("Type $typeId not found.");
        }

        return $this->types[$typeId];
    }
466502
public function getType($typeName)
    {
        if (!isset($this->types[$typeName])) {
            throw new \InvalidArgumentException("Type $typeName does not exists in the index.");
        }

        return $this->types[$typeName];
    }
653747
static public function getStorableType( $type )
    {
        switch ( $type )
        {
            case 'google':      return self::TYPE_GOOGLE;
            case 'facebook':    return self::TYPE_FACEBOOK;
            case 'yahoo':       return self::TYPE_YAHOO;
            case 'twitter':     return self::TYPE_TWITTER;
        }
    }
513744
public function inferType($type)
    {
        if (DataTypes::isPrimitive($type)) {
            return $type;
        } elseif (DataTypes::COLLECTION === strtolower($type)) {
            return $type;
        }
        return DataTypes::STRING;
    }
1029683
public function getNextOfType($type)
    {
        for (; $this->idx < $this->count; ++$this->idx) {
            if ($this->tokens[$this->idx]->type === $type) {
                return $this->tokens[$this->idx++];
            }
        }

        return null;
    }
1213189
public static function get($type)
    {
        if (!isset(static::$_modelFactories['Table'])) {
            static::$_modelFactories['Table'] = [TableRegistry::getTableLocator(), 'get'];
        }

        if (!isset(static::$_modelFactories[$type])) {
            throw new InvalidArgumentException(sprintf(
                'Unknown repository type "%s". Make sure you register a type before trying to use it.',
                $type
            ));
        }

        return static::$_modelFactories[$type];
    }
1097617
private static function processType(Type $type)
    {
        // TODO type-resolver v1 compat
        // if ($type instanceof AbstractList) {
        if ($type instanceof Array_) {
            return self::flatmap(function ($t) {
                return self::processType($t);
            }, [$type->getKeyType(), $type->getValueType()]);
        }

        if ($type instanceof Compound) {
            return self::flatmap(function ($t) {
                return self::processType($t);
            }, iterator_to_array($type));
        }

        if ($type instanceof Nullable) {
            return self::processType($type->getActualType());
        }

        if ($type instanceof Object_) {
            if (($fq = $type->getFqsen()) !== null) {
                return [ltrim((string) $fq, '\\')];
            }
        }

        return [];
    }
116780
public function getTypeClass($type)
    {
        if (isset($this->types[$type])) {
            return $this->types[$type];
        }

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

        return null;
    }
1004720
public static function getArrayType(string $type): ?string
    {
        if (substr($type, -2) !== '[]' || strlen($type) === 2) {
            return null;
        }

        return substr($type, 0, -2);
    }