@param mixed  $content
@param string $contentType

@return mixed
432428
public function decode($content, $contentType)
    {
        $converter = $this->getConverter($contentType);

        return $converter->decode($content);
    }
1035899
protected function getConfigForContentType(ContentType $contentType)
    {
        if ($this->hasConfigForContentType($contentType)) {
            return $this->config['override_by_type'][$contentType->identifier];
        }

        return [];
    }
1090539
public function loadGroupsOfContentType($contentTypeId)
    {
        $contentType = $this->contentTypeService->loadContentType($contentTypeId, Language::ALL);

        return new Values\ContentTypeGroupRefList(
            $contentType,
            $contentType->getContentTypeGroups()
        );
    }
610058
static public function contentTypeToSuffix($contentType)
    {
        $types = self::byContentType();
        return isset($types[$contentType]) ? $types[$contentType]['suffix'] : null;
    }
1121568
public function setContentType($contentType, $charset = null)
    {
        if ($charset === null) {
            $this->setHeader('Content-Type', $contentType);
        } else {
            $this->setHeader('Content-Type', $contentType . '; charset=' . $charset);
        }

        return $this;
    }
977215
public function getCMDLForContentType($contentTypeName)
    {
        if ($this->hasContentType($contentTypeName))
        {
            $url = 'content/' . $contentTypeName . '/cmdl';

            $response = $this->getClient()->get($url);
            $json     = $response->json();

            return $json['cmdl'];
        }

        throw new AnyContentClientException ('Unknown content type ' . $contentTypeName);

    }
622648
public function getRelated($contentType = null)
    {
        if ($contentType !== null) {
            return $this->getRelation($contentType);
        }

        return $this->getRelation()->all();
    }
401426
public function loadContentTypeDraft($contentTypeId)
    {
        $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentTypeId);

        return new Values\RestContentType(
            $contentTypeDraft,
            $contentTypeDraft->getFieldDefinitions()
        );
    }
1046993
public static function pq($html, $contentType = null)
    {
        self::initPhpQuery();
        return \phpQuery::newDocument($html, $contentType);
    }
1289585
public function getConfig($contentType)
    {
        if (array_key_exists($contentType, $this->searchableTypes)) {
            return $this->searchableTypes[$contentType];
        }

        if ($this->canSearchInvisible() && array_key_exists($contentType, $this->invisibleTypes)) {
            return $this->invisibleTypes[$contentType];
        }

        return false;
    }
1198523
protected A contentType(String contentType) {
        this.headers.add(Pair.of("Content-Type", contentType));
        return (A)this;
    }
640405
public static function createFromContent(
        string $content,
        ?InternetMediaTypeInterface $contentType = null
    ): WebResourceInterface {
        $className = get_called_class();

        return new $className(WebResourceProperties::create([
            WebResourceProperties::ARG_CONTENT => $content,
            WebResourceProperties::ARG_CONTENT_TYPE => $contentType,
        ]));
    }
616974
function contentType($contentType)
    {
        $this->requestDecorator->addHeader('X-Contentful-Content-Type', $contentType);
        $this->requestDecorator->addParameter('content_type', '=', $contentType);
        return $this;
    }
942447
public static function create($content = null, $contentType = 'text/plain')
    {
        $instance = new static();

        $instance->content = $content;
        $instance->contentType = $contentType;

        return $instance;
    }
878217
public function setContentType($contentType = null)
    {
        if ($contentType === null) {
            $contentType = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : null;
        }

        $this->contentType = $contentType;
    }
273225
public function content($content, $contentType = self::CONTENT_TYPE_HTML, $charset = null)
    {
        $this->getSwiftMessage()->setBody($content, $contentType, $charset);

        return $this;
    }
51126
public function loadFromContentType(ContentType $contentType): self
    {
        $languages = [];
        foreach ($contentType->languageCodes as $languageCode) {
            $languages[] = $this->languageService->loadLanguage($languageCode);
        }

        $this->data = array_map(
            function (Language $language) use ($contentType) {
                return $this->valueFactory->createLanguageFromContentType($language, $contentType);
            },
            $languages
        );

        return $this;
    }