@param ContentType $contentType

@return ContentTypeDraft
430995
private function getNewContentTypeDraft(ContentType $contentType)
    {
        try {
            $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentType->id);
        } catch (NotFoundException $e) {
            $contentTypeDraft = $this->contentTypeService->createContentTypeDraft($contentType);
        }

        return $contentTypeDraft;
    }
371776
public function createDraft($contentTypeIdentifier, array $fields)
    {
        $contentService = $this->repository->getContentService();

        $createStruct = $contentService->newContentCreateStruct(
            $this->repository->getContentTypeService()->loadContentTypeByIdentifier($contentTypeIdentifier),
            'eng-GB'
        );

        foreach ($fields as $fieldDefIdentifier => $fieldValue) {
            $createStruct->setField($fieldDefIdentifier, $fieldValue);
        }

        $locationCreateStruct = $this->repository->getLocationService()->newLocationCreateStruct(2);

        $this->currentDraft = $this->repository->sudo(
            function () use ($createStruct, $locationCreateStruct) {
                return $this->repository->getContentService()->createContent(
                    $createStruct,
                    [$locationCreateStruct]
                );
            }
        );

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

        $this->contentType = $contentType;
    }
1198523
protected A contentType(String contentType) {
        this.headers.add(Pair.of("Content-Type", contentType));
        return (A)this;
    }
462523
public function accept(string $contentType): HttpRequest
    {
        $contentType = trim($contentType);

        return $this->header("Accept", $contentType);
    }
551268
public function contentAlternative($content, $contentType = null, $charset = null)
    {
        $this->getSwiftMessage()->addPart($content, $contentType, $charset);

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

        return $this->getRelation()->all();
    }
1077214
public function setBody(string $body, string $contentType = 'text/html')
    {
        $this->setHeader('Content-Type', $contentType);
        $this->body = $body;
        return $this;
    }
979900
public function getFieldById(ContentTypeInterface $contentType, $fieldId)
    {
        $field = $this->om->getRepository($this->configurationManager->getEntityClass('field'))->find($fieldId);


        if (!$field instanceof FieldInterface) {
            return null;
        }
        if ($field->getContentType() && $field->getContentType()->getId() == $contentType->getId()) {
            return $field;
        }

        $parent = $field;
        while ($parent && $parentLayout = $parent->getLayout()) {
            if ($parent = $parentLayout->getParent()) {
                if ($parent->getContentType() !== null && $parent->getContentType()->getId() == $contentType->getId()) {
                    return $field;
                }
            }
        }

        return null;
    }
1046993
public static function pq($html, $contentType = null)
    {
        self::initPhpQuery();
        return \phpQuery::newDocument($html, $contentType);
    }
1286991
public function setType(string $contentType, ?string $charset = null): Response
	{
		$this->contentType = $contentType;

		if($charset !== null)
		{
			$this->charset = $charset;
		}

		return $this;
	}
1069235
protected function addContentTypeToHeader($headers, $contentType)
    {
        $keys = array_change_key_case(array_keys($headers), CASE_LOWER);

        if (!isset($keys['content-type'])) {
            $headers['content-type'] = [$contentType];
        }

        return $headers;
    }
353833
public function processFieldsChangeType(ContentTypeInterface $contentType, $fieldTypes)
    {
        foreach ($contentType->getFields() as $field) {
            if (!isset($fieldTypes[$field->getId()])) {
                continue;
            }
            if ($fieldTypes[$field->getId()] == $field->getType()) {
                continue;
            }

            $this->om->remove($field);

            $fieldClass = $this->configurationManager->getEntityClass('field');
            $newField = new $fieldClass;
            $newField->setType($field->getType());
            $newField->setContentType($field->getContentType());
            $newField->setName($field->getName());
            $newField->setSlug($field->getSlug());
            $newField->setRequired($field->isRequired());
            $newField->setSortOrder($field->getSortOrder());
            $newField->setOptions($field->getOptions());
            $newField->setHint($field->getHint());
            $this->om->persist($newField);
        }
    }
298873
public function body($body = '', $contentType = 'text/html')
    {
        $this->mailer->Body = $body;
        $this->mailer->ContentType = $contentType;
        return $this;
    }
371741
public function deleteContentTypeDraft($contentTypeId)
    {
        $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentTypeId);
        $this->contentTypeService->deleteContentType($contentTypeDraft);

        return new Values\NoContent();
    }
246618
public function getContentIdsByContentTypeId($contentTypeId)
    {
        $query = $this->dbHandler->createSelectQuery();
        $query
            ->select($this->dbHandler->quoteColumn('id'))
            ->from($this->dbHandler->quoteTable('ezcontentobject'))
            ->where(
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('contentclass_id'),
                    $query->bindValue($contentTypeId, null, PDO::PARAM_INT)
                )
            );

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(PDO::FETCH_COLUMN);
    }
124000
public function getContent(?string $contentType = null, ?string $contentKey = null): Core\ViewResource
    {
        return new Core\ViewResource($this->_getContent(@$this->content[$contentType][$contentKey]));
    }