@param TypeInterface|string $type

@return TypeInterface
185934
private function buildType($type)
    {
        if ($type instanceof TypeInterface) {
            return $type;
        }

        if (substr($type, -2) === '[]') {
            return new ArrayType($this->buildType(substr($type, 0, -2)));
        }

        return new Type($type);
    }
471503
final public function setType(string $type = null) : ColumnInterface
    {
        if ($type) {
            $available = [
                self::TYPE_ARRAY,
                self::TYPE_BIGINT,
                self::TYPE_BINARY,
                self::TYPE_BLOB,
                self::TYPE_BOOLEAN,
                self::TYPE_BOOLEAN_EMU,
                self::TYPE_BU_DATE,
                self::TYPE_BU_TIMESTAMP,
                self::TYPE_CHAR,
                self::TYPE_CLOB,
                self::TYPE_BINARY,
                self::TYPE_BLOB,
                self::TYPE_DATE,
                self::TYPE_DECIMAL,
                self::TYPE_DOUBLE,
                self::TYPE_ENUM,
                self::TYPE_FLOAT,
                self::TYPE_GEOMETRY,
                self::TYPE_INTEGER,
                self::TYPE_LONGVARBINARY,
                self::TYPE_NUMERIC,
                self::TYPE_OBJECT,
                self::TYPE_REAL,
                self::TYPE_SET,
                self::TYPE_SMALLINT,
                self::TYPE_TIME,
                self::TYPE_TIMESTAMP,
                self::TYPE_TINYINT,
                self::TYPE_VARCHAR,
                self::TYPE_VARBINARY,
            ];

            if (!in_array($type, $available)) {
                throw new \InvalidArgumentException('Invalid Propel type.');
            }
        }

        $this->type = $type;

        return $this;
    }
1064346
public function createType($type): CastInterface
    {
        $result = null;
        if (\is_callable($type)) {
            $result = new TypeClosure($type);
        } elseif (\in_array($type, Cast::TYPES, true)) {
            switch ($type) {
                case Cast::INT:
                    $result = new TypeInt();
                    break;
                case Cast::BOOL:
                    $result = new TypeBool();
                    break;
                case Cast::FLOAT:
                    $result = new TypeFloat();
                    break;
                case Cast::STRING:
                    $result = new TypeString();
                    break;
                case Cast::BINARY:
                    $result = new TypeBinary();
                    break;
                case Cast::OBJECT:
                    $result = new TypeObject();
                    break;
                case Cast::UNSET:
                    $result = new TypeUnset();
                    break;
                case Cast::ARRAY:
                    $result = new TypeArray();
                    break;
            }
        } elseif ($type instanceof CastInterface) {
            $result = $type;
        }

        if ($result === null) {
            throw new Exception('Type not found');
        }

        return $result;
    }
604109
private function resolveType(ObjectTypeInterface $type)
    {
        $parentType = $type->getParent();

        if (null !== $parentType) {
            $parentType = $this->registry->getType($parentType);
        }

        return $this->resolvedTypeFactory->createResolvedType(
            $type,
            // Type extensions are not supported for unregistered type instances,
            // i.e. type instances that are passed to the ObjectFactory directly,
            // nor for their parents, if getParent() also returns a type instance.
            [],
            $parentType
        );
    }
1025383
public function setType($type): self
    {
        if ($type instanceof Type) {
            $this->setIndex($type->getIndex()->getName());
            $type = $type->getName();
        }

        $this->_type = (string) $type;

        return $this;
    }
187888
public static function factory($type)
    {
        if ($type instanceof TypeInterface) return $type;

        if (strpos($type, "\\") === false) {
            $type = ucfirst(trim(strval($type)));
            if (strripos(strrev($type), strrev('type')) === false) $type .= 'Type';

            $type = "DataEntity\\Type\\" . $type;
        }

        if (
            !class_exists($type)
            || !in_array("DataEntity\\TypeInterface", class_implements($type))
        ) throw new \InvalidArgumentException('Type ' . $type . ' is invalid.');

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

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

        return null;
    }
244265
public function setType($type)
    {
        if ($this->formHelper->getFieldType($type)) {
            $this->type = $type;
        }

        return $this;
    }
1095423
public function setType( $type )
    {
        $this->type = is_int( $type ) ? $type : self::getStorableType( $type );
        return $this;
    }
1113775
public static function getInstance($type)
    {
        $classname = self::getClassname($type);

        if (!isset(self::$__instances[$classname])) {
            $instance = new $classname();
            self::$__instances[$classname] = $instance;
        }

        $instance = clone self::$__instances[$classname];

        return $instance;
    }
332501
public function byType($type)
    {
        $filtered_messages = $this->filterMessage('type', $type);

        $this->filtered = $filtered_messages;

        return $this;
    }
579088
public function setType($type)
    {
        if ($type === null) {
            $this->$type = $type;
        } else {
            $iconSetType = new IconSetTypeEnum($type);
            $this->type = $iconSetType->getValue();
        }

        return $this;
    }
1364765
public function addType($type)
    {
        if ($type instanceof Type) {
            $type = $type->getName();
        }

        if (!\is_string($type)) {
            throw new InvalidException('Invalid type type');
        }

        $this->_types[] = $type;

        return $this;
    }
486788
public function setType(string $type): ButtonInterface
    {
        if ($this->isVisibility()) {
            $this->type = $type;
        }

        return $this;
    }
849556
public function registerAsSingleton(string $type): self
    {
        $this->typeDefinition->register($type, true);
        return $this;
    }
651117
public static function of(string $type): SpecificationInterface
    {
        if (\function_exists('is_'.$type)) {
            return new PrimitiveType($type);
        }

        if ($type === 'variable') {
            return new VariableType;
        }

        if ($type === 'mixed') {
            return new MixedType;
        }

        return new ClassType($type);
    }
533768
public function type($type) {
        if (!array_key_exists($type, $this->orderedcollection)) {
            $this->orderedcollection[$type] = array();
        }
        return $this->orderedcollection[$type];
    }