@param $contentTypeName

@return boolean
358225
public function deleteContentTypeCMDL($contentTypeName)
    {
        $this->repositoryInfo = [];

        $this->getCMDLCache()->flushAll();

        try {
            $url = 'content/' . $contentTypeName;

            $this->getClient()->setDefaultOption('query',
                [
                    'userinfo' => [
                        'username'  => $this->userInfo->getUsername(),
                        'firstname' => $this->userInfo->getFirstname(),
                        'lastname'  => $this->userInfo->getLastname()
                    ]
                ]);

            $this->getClient()->delete($url);

            $contentTypeNames = $this->getConfiguration()->getContentTypeNames();

            if (($key = array_search($contentTypeName, $contentTypeNames)) !== false) {
                unset($contentTypeNames[$key]);
            }

            $this->getConfiguration()->addContentTypes($contentTypeNames);

            $this->getCMDLCache()->flushAll();

            return true;
        } catch (ClientException $e) {

            return false;
        }

    }
118150
public function getContentTypeDefinition($contentTypeName)
    {
        if ($this->getConfiguration()->hasContentType($contentTypeName))
        {
            $cacheKey = '[cmdl][content][' . $contentTypeName . ']';
            if ($this->repository)
            {
                $cacheKey = '[' . $this->repository->getName() . ']' . $cacheKey;
            }

            if ($this->cmdlCachingCheckLastModifiedDate)
            {
                $cacheKey .= '[' . $this->getCMDLLastModifiedDate($contentTypeName) . ']';
            }

            if ($this->getCMDLCache()->contains($cacheKey))
            {
                return unserialize($this->getCMDLCache()->fetch($cacheKey));
            }

            $cmdl = $this->getCMDLForContentType($contentTypeName);

            if ($cmdl)
            {

                $parser = $this->getParser();

                $definition = $parser->parseCMDLString($cmdl, $contentTypeName);

                if ($definition)
                {
                    $this->contentTypeDefinitions[$contentTypeName]['definition'] = $definition;
                    $this->getCMDLCache()->save($cacheKey, serialize($definition), (int)$this->cmdlCaching);

                    return $definition;
                }
            }

        }

        throw new AnyContentClientException ('Unknown content type ' . $contentTypeName);
    }
852809
public function addCompatibleContentType($contentType)
    {
        if (!\in_array($contentType, $this->compatibleContentTypes, true)) {
            $this->compatibleContentTypes[] = $contentType;
        }
    }
284530
public static function create(string $content, string $asName, string $contentType = null): ContentDownload
    {
        $self = new static($content);
        $self->setAsName($asName);

        if ($contentType !== null) {
            $self->setContentType($contentType);
        }

        return $self;
    }
665258
public function supports(string $contentType): bool
    {
        foreach (array_keys($this->types) as $pattern) {
            $pattern = str_replace(['*', '.', '/', '+'], ['(.*)', '.', '\/', '\+'], $pattern);
            if (preg_match("#^$pattern$#i", $contentType) > 0) {
                return true;
            }
        }
        return false;
    }
371741
public function deleteContentTypeDraft($contentTypeId)
    {
        $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentTypeId);
        $this->contentTypeService->deleteContentType($contentTypeDraft);

        return new Values\NoContent();
    }
45814
public function resolveUrlAliasSchema(Content $content, ContentType $contentType = null)
    {
        if ($contentType === null) {
            $contentType = $this->contentTypeHandler->load($content->contentInfo->contentTypeId);
        }

        return $this->resolve(
            strlen($contentType->urlAliasSchema) === 0 ? $contentType->nameSchema : $contentType->urlAliasSchema,
            $contentType,
            $content->fields,
            $content->versionInfo->languageCodes
        );
    }
878217
public function setContentType($contentType = null)
    {
        if ($contentType === null) {
            $contentType = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : null;
        }

        $this->contentType = $contentType;
    }
1030606
protected function hasConfigForContentType(ContentType $contentType)
    {
        if (!empty($this->config['override_by_type'])) {
            if (in_array($contentType->identifier, array_keys($this->config['override_by_type']))) {
                return true;
            }
        }

        return false;
    }
551384
public function getContentTypeName($contentType)
    {
        if (!$contentType instanceof ContentType) {
            try {
                $contentType = $this->contentTypeService->loadContentType($contentType);
            } catch (NotFoundException $e) {
                return '';
            }
        }

        return $contentType->getName();
    }
334642
public function isAsset(Content $content): bool
    {
        if ($this->contentTypeId === null) {
            $contentType = $this->contentTypeService->loadContentTypeByIdentifier(
                $this->mappings['content_type_identifier']
            );

            $this->contentTypeId = $contentType->id;
        }

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

        return new Values\ContentTypeGroupRefList(
            $contentType,
            $contentType->getContentTypeGroups()
        );
    }
861447
public function getAllRecords($contentTypeName = null, DataDimensions $dataDimensions = null)
    {
        if ($contentTypeName == null) {
            $contentTypeName = $this->getCurrentContentTypeName();
        }

        if ($dataDimensions == null) {
            $dataDimensions = $this->getCurrentDataDimensions();
        }

        $tableName = $this->getContentTypeTableName($contentTypeName);

        $sql = 'SELECT * FROM ' . $tableName . ' WHERE workspace = ? AND language = ? AND deleted = 0 AND validfrom_timestamp <= ? AND validuntil_timestamp > ?';

        $timestamp = TimeShifter::getTimeshiftTimestamp($dataDimensions->getTimeShift());

        $rows = $this->getDatabase()
                     ->fetchAllSQL($sql, [$dataDimensions->getWorkspace(), $dataDimensions->getLanguage(), $timestamp, $timestamp]);

        $records = [];
        foreach ($rows as $row) {
            $records[$row['id']] = $this->createRecordFromRow($row, $contentTypeName, $dataDimensions);
        }

        return $records;
    }
536308
public function selectHeaderContentType($contentType) {
		if (count($contentType) === 0 or (count($contentType) === 1 and $contentType[0] === '')) {
			return 'application/json';
		} elseif (preg_grep("/application\/json/i", $contentType)) {
			return 'application/json';
		} else {
			return implode(',', $contentType);
		}
	}
915512
public function setContentType($contentType)
    {
        if (is_bool(strpos($contentType, 'charset=')) && $this->charset) {
            $contentType .= '; charset=' . $this->charset;
        }
        
        $this->headers['Content-Type'] = $contentType;
        return $this;
    }
587289
public function delete($contentTypeId, $status)
    {
        if (Type::STATUS_DEFINED === $status && $this->contentTypeGateway->countInstancesOfType($contentTypeId)) {
            throw new BadStateException(
                '$contentTypeId',
                "ContentType with given id still has content instances and therefore can't be deleted"
            );
        }

        $this->contentTypeGateway->delete($contentTypeId, $status);

        // @todo FIXME: Return true only if deletion happened
        return true;
    }
361315
public function isElementInTable(string $name, ?string $contentType = null): bool
    {
        return (bool) $this->getElementPositionInTable($name, $contentType);
    }