sets the type to html or text. other types not allowed --> html mails are convertet to text/alternative
@param string $type
@throws MailException
17345
public function setType($type = self::TYPE_TEXT) {
		if (!in_array($type, array(self::TYPE_TEXT, self::TYPE_HTML))) {
			throw new MailException('invalid type: ' . $type);
		}
		$this->type = $type;
	}
292399
public function setType(?string $type): Workflow
    {
        if ($type !== null) {
            Assert::oneOf($type, self::VALID_TYPES);
        }
        $this->type = $type;

        return $this;
    }
116639
public function setEnctype(string $enctype): Form
    {
        $enctypes = [
            'application/x-www-form-urlencoded',
            'multipart/form-data',
            'text/plain'
        ];

        // Safety first. Only allow 'post' or 'get' here.
        if (!in_array(strtolower($enctype), $enctypes)) {
            Throw new FormException('Wrong html form enctype attribute set.', 1000);
        }

        $this->attribute['enctype'] = $enctype;

        return $this;
    }
1075408
public function setMimetype($type)
    {
        if ($type === null || $type === false) {
            $this->mimetype = null;

            return $this;
        }

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

        $this->mimetype = $type;

        return $this;
    }
792926
public function setType(string $type): Button
    {
        $types = [
            'submit',
            'reset',
            'button'
        ];

        if (! in_array($type, $types)) {
            Throw new FormException('Wrong button type set.');
        }

        $this->type = $type;

        return $this;
    }
623081
public function setType($type)
    {
        $acceptableTypes = ['pivot', 'item'];
        if (!in_array($type, $acceptableTypes)) {
            throw new InvalidConfigException('Browser response bundle must be one of the following types: ' . implode(', ', $acceptableTypes));
        }
        $this->_type = $type;
    }
1009926
public function setType($type)
    {
        if (strlen($type) == 0) {
            throw new \InvalidArgumentException(sprintf('MIME type should not be empty'));
        }

        if (!preg_match('@^[^/]+/[^/]+$@', $type)) {
            throw new \InvalidArgumentException(sprintf('Invalid MIME type: %s', $type));
        }

        $this->type = $type;

        return $this;
    }
1057626
public function setInputType($type)
    {
        if (empty($type)) {
            $this->inputType = null;
            return $this;
        }

        if (!is_string($type)) {
            throw new InvalidArgumentException(
                'Property input type must be a string'
            );
        }

        $this->inputType = $type;

        return $this;
    }
959964
public function setTypeAttribute($type)
    {
        if (!$type instanceof ContentType) {
            $type = ContentType::getByName($type);
        }
        if (!$type) {
            throw new InvalidArgumentException('Unknown content type');
        }
        $this->type()->associate($type);
    }
1338153
public static function setTypeMsg($type, $msg=null)
    {
        if (is_array($type)) {
            self::$typeMsg=array_merge(self::$typeMsg, $type);
        } else {
            self::$typeMsg[$type]=$msg;
        }
    }
785534
@Override
	public void setContent(final Object content, final String type) throws MessagingException
	{
		charset = EmailExtensions.getCharsetFromContentType(type);
		super.setContent(content, type);
	}
605075
public function setByType($type)
    {
        if (isset(self::$typeList[$type])) {
            $this->value = self::$typeList[$type];
        } else {
            throw new Exception("undefined index $type");
        }
    }
433227
private function setType(string $type): self
    {
        switch ($type) {
            case 'navigator.id.getAssertion': // fall through
            case 'navigator.id.finishEnrollment':
                break;
            default:
                throw new IDE(IDE::MALFORMED_DATA, 'typ');
        }
        $this->typ = $type;
        return $this;
    }
1324200
protected function setTransportType($type)
    {
        $type = ucfirst($type);

        switch ($type) {
            case 'Mail':
                $this->createMailTransport();
                $transport = $this->getMailTransport();
                break;
            case 'Smtp':
                $this->createSmtpTransport();
                $transport = $this->getSmtpTransport();
                break;
            case 'Sendmail':
                $this->createSendMailTransport();
                $transport = $this->getSendMailTransport();
                break;
        }

        $this->transport = $transport;
    }
926360
public function setType($type)
    {
        $this->type = $type;

        switch ($type) {
            case 'text':
            case 'string':
                $this->operatorOpts = ['equals', 'notequals', 'contains'];
                break;
            case 'integer':
                $this->operatorOpts = ['equals', 'notequals', 'greaterthan', 'lessthan'];
                break;
            case 'boolean':
                $this->operatorOpts = ['equals'];
                break;
        }

        return $this;
    }
157705
public function setType($type)
    {
        if (!is_string($type) && (null !== $type)) {
            require_once 'Zend/Server/Reflection/Exception.php';
            throw new Zend_Server_Reflection_Exception('Invalid parameter type');
        }

        $this->_type = $type;
    }
97187
public function setType($type)
    {
      if(!is_string($type) || strlen(trim($type)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid type, must be a non empty string');

      $this->type = $type;
    }