Set column datatype.

@param string|AbstractType $type

@throws Exception\InvalidArgumentException when the type is not supported

@return Column
548224
public function setType($type)
    {
        if (is_string($type)) {
            $type = ColumnType::createType($type);
        } elseif (!$type instanceof AbstractType) {
            throw new Exception\InvalidArgumentException(__METHOD__ . ' setType() accepts only AbstractType or string.');
        }
        $this->properties['type'] = $type;

        return $this;
    }
906538
public function setType($type)
    {
        if (is_string($type)) {
            if ('all' == strtolower($type)) {
                $this->type = array_keys($this->cards);
            } else {
                $this->type = explode(',', $type);
            }
        } elseif (is_array($type)) {
            $this->type = $type;
        } else {
            throw new \InvalidArgumentException(sprintf(
                'Expected argument of type array or string, "%s" given',
                is_object($type) ? get_class($type) : gettype($type)
            ));
        }

        return $this;
    }
186337
public function setType($type) {
        if (!$this->isValidType($type)) {
            throw new InvalidTypeException('Type must be one of Metric::TYPE_*');
        }
        $this->type = $type;

        return $this;
    }
510683
public function setTypes($types){
		if(!($types instanceof Traversable || is_array($types)))
			throw new InvalidArgumentException('Argument 1 must be an array or Traversable.');
		foreach($types as $column => $type){
			$this->setType($column, $type);
		}
		return $this;
	}
998468
public function setType($type)
    {
        if (!in_array($type, $this->getAvailableTypes())) {
            throw new \InvalidArgumentException('Unknown dependency type "' . $type . '"');
        }
        $this->type = $type;
        return $this;
    }
1109786
public function setType(int $type)
    {
        $typeList = [
            self::TYPE_INDEX,
            self::TYPE_NEXT_INDEX,
            self::TYPE_PROPERTY,
        ];
        if (!in_array($type, $typeList)) {
            throw new DomainException("Invalid reference type: {$type}");
        }
        $this->type = (int) $type;
        return $this;
    }
643735
final public function setSqlType(string $sqlType = null) : ColumnInterface
    {
        if ($sqlType) {
            $available = [
                self::SQL_TYPE_BOOLEAN,
                self::SQL_TYPE_DOUBLE,
                self::SQL_TYPE_FLOAT,
                self::SQL_TYPE_INT,
                self::SQL_TYPE_INTEGER,
                self::SQL_TYPE_STRING,
            ];

            if (!in_array($sqlType, $available)) {
                if (!class_exists($sqlType)) {
                    throw new \InvalidArgumentException('Invalid SQL type: '.$sqlType);
                } else {
                    $reflection = new \ReflectionClass($sqlType);
                    if (!$reflection->isSubclassOf(Behavior::class)) {
                        throw new \InvalidArgumentException('SQL type '.$sqlType.' must be instance of '.Behavior::class);
                    }
                }
            }
        }

        $this->sqlType = $sqlType;

        return $this;
    }
1095423
public function setType( $type )
    {
        $this->type = is_int( $type ) ? $type : self::getStorableType( $type );
        return $this;
    }
1115012
public function setType($type = '') {
        if (!\in_array($type, self::$allowed_input_types, true)) {
            throw new InvalidArgumentException('Unsupported column input type. Possible are: ' . implode(', ', self::$allowed_input_types));
        }

        $this->selected_input_type = $type;

        // Update some params based on type
        switch ($this->selected_input_type) {
            case 'checkbox': case 'radio': case 'delete':
                $this->setWidth('1%');
                $this->disableNewlines();
                $this->enableCenterAlign();
            break;
        }

        return $this;
    }
1141389
public function setType($type)
    {
        if (empty($type)) {
            $this->type = null;
            return $this;
        }

        if (!is_string($type)) {
            throw new InvalidArgumentException(
                'Form property widget type must be a string'
            );
        }

        if ($this->propertyFactory()->isResolvable($type)) {
            $this->setPropertyType($type);
        }

        $this->type = $type;

        return $this;
    }
1194794
public function setType($type)
    {
        if (!isset($this->types[$type])) {
            throw new InvalidArgumentException('type must be one of:' . implode(', ', array_keys($this->types)));
        }

        $this->type = $type;

        return $this;
    }
1354190
public function set($requiredType)
    {
        if (!in_array($requiredType, $this->validTypes)) {
            throw new \InvalidArgumentException("{$requiredType} is not a supported number type");
        }
        if ($requiredType == self::TYPE_GMP && !extension_loaded('gmp')) {
            throw new \InvalidArgumentException('GMP not supported');
        }

        $this->requiredType = $requiredType;

        return $this;
    }
827880
public function setType(string $type) : void
    {
        if (empty($type)) {
            throw new InvalidArgumentException('Empty field type is not allowed: ' . $this->getName());
        }

        $this->_type = $this->_extractType($type);
    }
297663
public function setType($type)
    {
        if ($type === null) {
            $type = self::TYPE_UNDEFINED;
        }

        $this->type = $type;

        return $this;
    }
1229705
protected function setDataType(Field & $field, $type)
    {
        $map = $this->dataTypeMap();

        if (array_key_exists($type, $map)) {
            $field->dataType = $map[$type];
        }

        return $this;
    }
658126
protected function setType($type)
    {
        if ($type == '*/*' || $type == 'application/octet-stream')
        {
            $type = \Module\HttpFoundation\getMimeTypeOfFile($this->getTmpName(), false);
            if ( empty($type) )
                if ( null !== $solved = \Module\HttpFoundation\getMimeTypeOfFile($this->getClientFilename()) )
                    $type = $solved;
                else
                    $type = 'application/octet-stream';
        }

        $this->type = (string) $type;
        return $this;
    }
587218
public function setBaseType($base_type)
    {
        $base_type = strtoupper($base_type);
        if (!in_array($base_type, self::getBaseTypes())) {
            throw new \InvalidArgumentException(sprintf('The "%s" base type is not a valid base type.', $base_type));
        }
        $this->base_type = $base_type;
        return $this;
    }