Gets type as rtf code

@return string rtf code
@throws PHPRtfLite_Exception, if type is not allowed,
because of the rtf document specific settings.
961311
protected function getTypeAsRtfCode()
    {
        $rtfType = $this->getRtfType();

        switch ($this->_type) {
            case self::TYPE_ALL:
                if (!$this->_rtf->isOddEvenDifferent()) {
                    return $rtfType;
                }

                throw new PHPRtfLite_Exception('Header/Footer type ' . $this->_type . ' is not allowed, '
                                             . 'when using odd even different!');

            case self::TYPE_LEFT:
                if ($this->_rtf->isOddEvenDifferent()) {
                    return $rtfType . 'l';
                }

                throw new PHPRtfLite_Exception('Header/Footer type ' . $this->_type . ' is not allowed, '
                                             . 'when using not odd even different!');

            case self::TYPE_RIGHT:
                if ($this->_rtf->isOddEvenDifferent()) {
                    return $rtfType . 'r';
                }

                throw new PHPRtfLite_Exception('Header/Footer type ' . $this->_type . ' is not allowed, '
                                             . 'when using not odd even different!');

            case self::TYPE_FIRST:
                if ($this->_rtf->hasSpecialLayoutForFirstPage()) {
                    return $rtfType . 'f';
                }

                throw new PHPRtfLite_Exception('Header/Footer type ' . $this->_type . ' is not allowed, '
                                             . 'when using not special layout for first page!');

            default:
                throw new PHPRtfLite_Exception('Header/Footer type is not defined! You gave me: ', $this->_type);
        }
    }
455219
function getType()
    {
        if($this->_type) {
            return $this->_type;
        }
        else {
            $myclass = get_class($this);
            return strtolower(substr($myclass, strrpos($myclass, '\\') + 1, -5));
        }
    }
386069
public final function get_activity_type() {
        $class = get_class($this);
        $package = stristr($class, "\\", true);
        $type = str_replace("mod_", "", $package);
        if ($type === $package) {
            throw new \coding_exception("$class does not belong to any module specific namespace");
        }
        return $type;
    }
449438
@Override
    public TYPE getType() {
        final IPortalUrlBuilder portalUrlBuilder = this.portletUrlBuilder.getPortalUrlBuilder();
        final UrlType urlType = portalUrlBuilder.getUrlType();
        return urlType.getPortletUrlType();
    }
401970
public function get_type()
	{
		if (isset($this->file->headers['content-type']))
		{
			if (!isset($this->file->headers['content-encoding'])
				&& ($this->file->headers['content-type'] === 'text/plain'
					|| $this->file->headers['content-type'] === 'text/plain; charset=ISO-8859-1'
					|| $this->file->headers['content-type'] === 'text/plain; charset=iso-8859-1'
					|| $this->file->headers['content-type'] === 'text/plain; charset=UTF-8'))
			{
				return $this->text_or_binary();
			}

			if (($pos = strpos($this->file->headers['content-type'], ';')) !== false)
			{
				$official = substr($this->file->headers['content-type'], 0, $pos);
			}
			else
			{
				$official = $this->file->headers['content-type'];
			}
			$official = trim(strtolower($official));

			if ($official === 'unknown/unknown'
				|| $official === 'application/unknown')
			{
				return $this->unknown();
			}
			elseif (substr($official, -4) === '+xml'
				|| $official === 'text/xml'
				|| $official === 'application/xml')
			{
				return $official;
			}
			elseif (substr($official, 0, 6) === 'image/')
			{
				if ($return = $this->image())
				{
					return $return;
				}
				else
				{
					return $official;
				}
			}
			elseif ($official === 'text/html')
			{
				return $this->feed_or_html();
			}
			else
			{
				return $official;
			}
		}
		else
		{
			return $this->unknown();
		}
	}
140144
public function getType() {
		if ($this->moufManager->getCode($this->getIdentifierName())===null) {
			return self::TYPE_DECLARATIVE;
		} else {
			return self::TYPE_PHP;
		}
	}
311566
public function getFormattedAttributes()
    {
        $rtn = "";
        foreach($this->listAttributes() as $name => $value)
        {
            $rtn .= sprintf(" %s=\"%s\"",htmlentities($name),htmlentities($value));
        }
        return $rtn;
    }
126976
public function getMimeType(): string
    {
        $mimes = new MimeTypes();

        $type = $mimes->getMimeType($this->getAttribute('extension'));

        return $type ?? 'unknown';
    }
281102
private function loadTypoScript(): string
    {
        if (null === $this->options['cache_dir']) {
            return $this->concatenateTypoScript();
        }

        $cache = $this->getConfigCacheFactory()
            ->cache($this->options['cache_dir'].'/content_elements.typoscript',
                function (ConfigCacheInterface $cache) {
                    $cache->write(
                        $this->concatenateTypoScript(),
                        $this->getRenderDefinitionCollection()->getResources()
                    );
                }
            )
        ;

        return \file_get_contents($cache->getPath());
    }
494028
public function getRawContent()
    {
        if ($this->size == 0) {
            return '';
        }

        if ($this->encoding === 'base64') {
            $raw = base64_decode($this->content, true);
            if ($raw === false) {
                throw new \RuntimeException('Failed to decode content');
            }

            return $raw;
        }

        throw new \RuntimeException('Unrecognised blob encoding: ' . $this->encoding);
    }
238324
public function toRtf()
	{
		$rtf = '{';
		
		foreach ($this->children as $child) {
			$rtf .= $child->format('rtf');
		} 

		$rtf .= '}';
		
		return $rtf;
	}
738916
public function open()
    {
        if ($this->_handle !== null) {
            return;
        }

        $this->_handle = fopen($this->_filename, 'wr', false);
        if (!$this->_handle) {
            throw new PHPRtfLite_Exception("Could not open rtf output stream (url: $this->_filename)!");
        }
        flock($this->_handle, LOCK_EX);
    }
1118035
public function getMediaType() : ?string 
    {
        if ( ! $this->hasMediaType()) {
            $this->setMediaType($this->getDefaultMediaType());
        }
        return $this->mediaType;
    }
69291
public int rtf(XPathContext support)
  {

    int result = rtf();

    if (DTM.NULL == result)
    {
      DTM frag = support.createDocumentFragment();

      // %OPT%
      frag.appendTextChild(str());

      result = frag.getDocument();
    }

    return result;
  }
1011355
public function render()
    {
        $stream = $this->_rtf->getWriter();
        $text = $this->_text;

        if (!$this->_isRtfCode) {
            $charset = $this->_rtf->getCharset();
            $text = PHPRtfLite::quoteRtfCode($text);
            if ($this->_convertTagsToRtf) {
                $text = self::convertTagsToRtf($text, $charset);
            }
            $text = PHPRtfLite_Utf8::getUnicodeEntities($text, $charset);
        }

        $stream->write($this->getOpeningToken());

        if ($this->_font) {
            $stream->write($this->_font->getContent());
        }
        if (!$this->isEmptyParagraph() || $this->_isRtfCode) {
            $stream->write($text);
        }

        $stream->write($this->getClosingToken() . "\r\n");
    }
281719
public function getType()
    {
        if($this->_type == null) {
            $this->_type = parse_url($this->_path, PHP_URL_HOST);
        }

        return $this->_type;
    }
628260
public function getTypeText()
    {
        switch ($this->type) {
            case 'follow_user':
                return Yii::t('notification', 'follow on you');
                break;
            case 'answer_question':
                return Yii::t('notification', 'answered the question');
                break;
            case 'follow_question':
                return Yii::t('notification', 'is concerned about the problem');
                break;
            case 'comment_question':
                return Yii::t('notification', 'commented on the question');
                break;
            case 'invite_answer':
                return Yii::t('notification', 'invited you to answer');
                break;
            case 'adopt_answer':
                return Yii::t('notification', 'accepted your answer');
                break;
            default:
                return null;
                break;
        }
    }