Returns content type name for provided content type ID or content type object.

@param mixed|\eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType

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

        return $contentType->getName();
    }
1300674
public final B contentType(CharSequence contentType) {
        requireNonNull(contentType, "contentType");
        autoDetectedContentType(false);
        return setHeader(HttpHeaderNames.CONTENT_TYPE, contentType);
    }
240353
public function getContentIdsByContentTypeId($contentTypeId)
    {
        try {
            return $this->innerGateway->getContentIdsByContentTypeId($contentTypeId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
616974
function contentType($contentType)
    {
        $this->requestDecorator->addHeader('X-Contentful-Content-Type', $contentType);
        $this->requestDecorator->addParameter('content_type', '=', $contentType);
        return $this;
    }
477884
public function getWebResourceClassName($contentType)
    {
        return ($this->hasMappedWebResourceClassName($contentType))
            ? $this->contentTypeWebResourceMap[(string)$contentType]
            : self::DEFAULT_WEB_RESOURCE_MODEL;
    }
1244737
public function getContentTypeName(string $identifier): string
    {
        try {
            $contentType = $this->loadContentType($identifier);

            return $contentType->getName() ?? '';
        } catch (Throwable $t) {
            return '';
        }
    }
505422
public function save(ContentType $contentType)
    {
        $this->em->persist($contentType);
        $this->em->flush();

        return $contentType;
    }
817722
def get_content_type(self, content_type):
        
        qs = self.get_queryset()
        return qs.filter(content_type__name=content_type)
309745
private function getRelationsList(ContentType $contentType)
    {
        $list = [];
        if (!isset($contentType['relations']) || !is_array($contentType['relations'])) {
            return $list;
        }

        foreach ($contentType['relations'] as $relationName => $relationValues) {
            /** @var Repository\ContentRepository $repo */
            $repo = $this->em->getRepository($relationName);
            $relationConfig = $this->config->get('contenttypes/' . $relationName, []);
            $neededFields = $this->neededFields($relationValues, $relationConfig);
            $order = isset($relationValues['order']) ? $relationValues['order'] : null;

            $list[$relationName] = $repo->getSelectList($relationConfig, $order, $neededFields);
        }

        return $list;
    }
94086
private static function getParametersFromContentType(string $contentType): array
    {
        $parameters = array_merge(
            self::getParametersFromGlobal($_GET),
            self::getParametersFromGlobal($_POST),
            self::getParametersFromGlobal($_FILES));
        $paramsSource = [];
        $rawInput = file_get_contents('php://input');
        switch ($contentType) {
            case ContentType::JSON:
                $paramsSource = (array) json_decode($rawInput);
                break;
            case ContentType::XML:
            case ContentType::XML_APP:
                $xml = new \SimpleXMLElement($rawInput);
                $paramsSource = (array) $xml;
                break;
            default:
                parse_str($rawInput, $paramsSource);
        }
        return array_merge($parameters, self::getParametersFromGlobal($paramsSource));
    }
767015
protected function getTitleColumnNames($contentType)
    {
        Deprecated::method();

        // If we specified a specific field name or array of field names as 'title'.
        if (!empty($contentType['title_format'])) {
            return (array) $contentType['title_format'];
        }

        $names = [
            'title', 'name', 'caption', 'subject', 'heading', //EN
            'titel', 'naam', 'onderwerp', // NL
            'nom', 'sujet', // FR
            'nombre', 'sujeto', // ES
            'titulo', 'nome', 'subtitulo', 'assunto', // PT
        ];

        foreach ($names as $name) {
            if (isset($contentType['fields'][$name])) {
                return [$name];
            }
        }

        // Otherwise, grab the first field of type 'text', and assume that's the title.
        if (!empty($contentType['fields'])) {
            foreach ($contentType['fields'] as $key => $field) {
                if ($field['type'] === 'text') {
                    return [$key];
                }
            }
        }

        // If this is a ContentType without any text fields, we can't provide a proper title.
        return [];
    }
929948
public function setContentType($contentType)
    {
        $allowedValues = $this->getContentTypeAllowableValues();
        if (!is_null($contentType) && !in_array($contentType, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'contentType', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['contentType'] = $contentType;

        return $this;
    }
1354484
private function detachContentTypeGroupsByIdentifiers(ContentType $contentType, array $contentTypeGroupsIdentifiers)
    {
        $contentTypeGroups = $this->loadContentTypeGroupsByIdentifiers($contentTypeGroupsIdentifiers);
        foreach ($contentTypeGroups as $contentTypeGroup) {
            $this->contentTypeService->unassignContentTypeGroup($contentType, $contentTypeGroup);
        }
    }
920481
public function setContenttype($contenttype)
    {
        if (is_string($contenttype)) {
            $contenttype = $this->app['storage']->getContenttype($contenttype);
        }

        $this->contenttype = $contenttype;
    }
1136474
private function getResponseCharset($contentType)
    {
        $start = strpos($contentType, '=');
        $type = '';

        if ($start !== false)
        {
            $type = strtoupper(trim(substr($contentType, $start + 1)));
        }

        return $type;
    }
1278573
public function getContentType()
    {
        $contentType = $this->getSubject()->contenttype;
        if ($contentType !== null && isset($contentType['slug'])) {
            return $contentType['slug'];
        }

        return null;
    }
914338
public static function setContentType($contentType, $encoding = null) {
		$value = $contentType;
		if (isset ( $encoding ))
			$value .= ' ;charset=' . $encoding;
		self::header ( 'Content-Type', $value );
	}