Class

eZ\Publish\Core\REST\Server\Controller\ContentType

class ContentType extends Controller

ContentType controller.

Methods

setInputDispatcher(Dispatcher $inputDispatcher)

from Controller
setRouter(RouterInterface $router)

from Controller
setRepository(Repository $repository)

from Controller
setRequestParser(RequestParser $requestParser)

from Controller
__construct(ContentTypeService $contentTypeService)

Construct controller.

CreatedContentTypeGroup createContentTypeGroup(Request $request)

Creates a new content type group.

ContentTypeGroup updateContentTypeGroup($contentTypeGroupId, Request $request)

Updates a content type group.

ContentTypeList|ContentTypeInfoList listContentTypesForGroup($contentTypeGroupId, Request $request)

Returns a list of content types of the group.

NoContent deleteContentTypeGroup(mixed $contentTypeGroupId)

The given content type group is deleted.

ContentTypeGroupList loadContentTypeGroupList(Request $request)

Returns a list of all content type groups.

ContentTypeGroup loadContentTypeGroup($contentTypeGroupId $contentTypeGroupId)

Returns the content type group given by id.

RestContentType loadContentType($contentTypeId $contentTypeId)

Loads a content type.

ContentTypeList|ContentTypeInfoList listContentTypes(Request $request)

Returns a list of content types.

ContentType loadContentTypeByIdentifier(Request $request)

Loads a content type by its identifier.

ContentType loadContentTypeByRemoteId(Request $request)

Loads a content type by its remote ID.

CreatedContentType createContentType($contentTypeGroupId, Request $request)

Creates a new content type draft in the given content type group.

ResourceCreated copyContentType($contentTypeId $contentTypeId)

Copies a content type.

CreatedContentType createContentTypeDraft($contentTypeId, Request $request)

Creates a draft and updates it with the given data.

RestContentType loadContentTypeDraft($contentTypeId $contentTypeId)

Loads a content type draft.

RestContentType updateContentTypeDraft($contentTypeId, Request $request)

Updates meta data of a draft.

CreatedFieldDefinition addContentTypeDraftFieldDefinition($contentTypeId, Request $request)

Creates a new field definition for the given content type draft.

FieldDefinitionList loadContentTypeFieldDefinitionList($contentTypeId $contentTypeId)

Loads field definitions for a given content type.

RestFieldDefinition loadContentTypeFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)

Returns the field definition given by id.

FieldDefinitionList loadContentTypeDraftFieldDefinitionList($contentTypeId $contentTypeId)

Loads field definitions for a given content type draft.

RestFieldDefinition loadContentTypeDraftFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)

Returns the draft field definition given by id.

FieldDefinitionList updateContentTypeDraftFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)

Updates the attributes of a field definition.

NoContent removeContentTypeDraftFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)

Deletes a field definition from a content type draft.

RestContentType publishContentTypeDraft($contentTypeId $contentTypeId)

Publishes a content type draft.

NoContent deleteContentType($contentTypeId $contentTypeId)

The given content type is deleted.

NoContent deleteContentTypeDraft($contentTypeId $contentTypeId)

The given content type draft is deleted.

ContentTypeGroupRefList loadGroupsOfContentType($contentTypeId $contentTypeId)

Returns the content type groups the content type belongs to.

ContentTypeGroupRefList linkContentTypeToGroup($contentTypeId, Request $request)

Links a content type group to the content type and returns the updated group list.

ContentTypeGroupRefList unlinkContentTypeFromGroup($contentTypeId $contentTypeId, $contentTypeGroupId $contentTypeGroupId)

Removes the given group from the content type and returns the updated group list.

Details

in Controller at line 45
public setInputDispatcher(Dispatcher $inputDispatcher)

Parameters

Dispatcher $inputDispatcher

in Controller at line 50
public setRouter(RouterInterface $router)

Parameters

RouterInterface $router

in Controller at line 55
public setRepository(Repository $repository)

Parameters

Repository $repository

in Controller at line 60
public setRequestParser(RequestParser $requestParser)

Parameters

RequestParser $requestParser

at line 44
public __construct(ContentTypeService $contentTypeService)

Construct controller.

Parameters

ContentTypeService $contentTypeService

at line 56
public CreatedContentTypeGroup createContentTypeGroup(Request $request)

Creates a new content type group.

Parameters

Request $request

Return Value

CreatedContentTypeGroup

Exceptions

ForbiddenException

at line 85
public ContentTypeGroup updateContentTypeGroup($contentTypeGroupId, Request $request)

Updates a content type group.

Parameters

$contentTypeGroupId
Request $request

Return Value

ContentTypeGroup

Exceptions

ForbiddenException

at line 113
public ContentTypeList|ContentTypeInfoList listContentTypesForGroup($contentTypeGroupId, Request $request)

Returns a list of content types of the group.

Parameters

$contentTypeGroupId
Request $request

Return Value

ContentTypeList|ContentTypeInfoList

at line 135
public NoContent deleteContentTypeGroup(mixed $contentTypeGroupId)

The given content type group is deleted.

Parameters

mixed $contentTypeGroupId

Return Value

NoContent

Exceptions

ForbiddenException

at line 154
public ContentTypeGroupList loadContentTypeGroupList(Request $request)

Returns a list of all content type groups.

Parameters

Request $request

Return Value

ContentTypeGroupList

at line 183
public ContentTypeGroup loadContentTypeGroup($contentTypeGroupId $contentTypeGroupId)

Returns the content type group given by id.

Parameters

$contentTypeGroupId $contentTypeGroupId

Return Value

ContentTypeGroup

at line 195
public RestContentType loadContentType($contentTypeId $contentTypeId)

Loads a content type.

Parameters

$contentTypeId $contentTypeId

Return Value

RestContentType

at line 210
public ContentTypeList|ContentTypeInfoList listContentTypes(Request $request)

Returns a list of content types.

Parameters

Request $request

Return Value

ContentTypeList|ContentTypeInfoList

at line 256
public ContentType loadContentTypeByIdentifier(Request $request)

Loads a content type by its identifier.

Parameters

Request $request

Return Value

ContentType

at line 268
public ContentType loadContentTypeByRemoteId(Request $request)

Loads a content type by its remote ID.

Parameters

Request $request

Return Value

ContentType

at line 285
public CreatedContentType createContentType($contentTypeGroupId, Request $request)

Creates a new content type draft in the given content type group.

Parameters

$contentTypeGroupId
Request $request

Return Value

CreatedContentType

Exceptions

ForbiddenException
BadRequestException

at line 347
public ResourceCreated copyContentType($contentTypeId $contentTypeId)

Copies a content type.

The identifier of the copy is changed to copyof_ and a new remoteId is generated.

Parameters

$contentTypeId $contentTypeId

Return Value

ResourceCreated

at line 370
public CreatedContentType createContentTypeDraft($contentTypeId, Request $request)

Creates a draft and updates it with the given data.

Parameters

$contentTypeId
Request $request

Return Value

CreatedContentType

Exceptions

ForbiddenException

at line 419
public RestContentType loadContentTypeDraft($contentTypeId $contentTypeId)

Loads a content type draft.

Parameters

$contentTypeId $contentTypeId

Return Value

RestContentType

at line 438
public RestContentType updateContentTypeDraft($contentTypeId, Request $request)

Updates meta data of a draft.

This method does not handle field definitions.

Parameters

$contentTypeId
Request $request

Return Value

RestContentType

Exceptions

ForbiddenException

at line 477
public CreatedFieldDefinition addContentTypeDraftFieldDefinition($contentTypeId, Request $request)

Creates a new field definition for the given content type draft.

Parameters

$contentTypeId
Request $request

Return Value

CreatedFieldDefinition

Exceptions

ForbiddenException
NotFoundException

at line 525
public FieldDefinitionList loadContentTypeFieldDefinitionList($contentTypeId $contentTypeId)

Loads field definitions for a given content type.

Parameters

$contentTypeId $contentTypeId

Return Value

FieldDefinitionList

at line 545
public RestFieldDefinition loadContentTypeFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)

Returns the field definition given by id.

Parameters

$contentTypeId
$fieldDefinitionId
Request $request

Return Value

RestFieldDefinition

Exceptions

NotFoundException

at line 568
public FieldDefinitionList loadContentTypeDraftFieldDefinitionList($contentTypeId $contentTypeId)

Loads field definitions for a given content type draft.

Parameters

$contentTypeId $contentTypeId

Return Value

FieldDefinitionList

at line 588
public RestFieldDefinition loadContentTypeDraftFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)

Returns the draft field definition given by id.

Parameters

$contentTypeId
$fieldDefinitionId
Request $request

Return Value

RestFieldDefinition

Exceptions

NotFoundException

at line 615
public FieldDefinitionList updateContentTypeDraftFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)

Updates the attributes of a field definition.

Parameters

$contentTypeId
$fieldDefinitionId
Request $request

Return Value

FieldDefinitionList

Exceptions

ForbiddenException
NotFoundException

at line 670
public NoContent removeContentTypeDraftFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)

Deletes a field definition from a content type draft.

Parameters

$contentTypeId
$fieldDefinitionId
Request $request

Return Value

NoContent

Exceptions

NotFoundException

at line 702
public RestContentType publishContentTypeDraft($contentTypeId $contentTypeId)

Publishes a content type draft.

Parameters

$contentTypeId $contentTypeId

Return Value

RestContentType

Exceptions

ForbiddenException

at line 730
public NoContent deleteContentType($contentTypeId $contentTypeId)

The given content type is deleted.

Parameters

$contentTypeId $contentTypeId

Return Value

NoContent

Exceptions

ForbiddenException

at line 750
public NoContent deleteContentTypeDraft($contentTypeId $contentTypeId)

The given content type draft is deleted.

Parameters

$contentTypeId $contentTypeId

Return Value

NoContent

at line 765
public ContentTypeGroupRefList loadGroupsOfContentType($contentTypeId $contentTypeId)

Returns the content type groups the content type belongs to.

Parameters

$contentTypeId $contentTypeId

Return Value

ContentTypeGroupRefList

at line 785
public ContentTypeGroupRefList linkContentTypeToGroup($contentTypeId, Request $request)

Links a content type group to the content type and returns the updated group list.

Parameters

$contentTypeId
Request $request

Return Value

ContentTypeGroupRefList

Exceptions

ForbiddenException
BadRequestException

at line 838
public ContentTypeGroupRefList unlinkContentTypeFromGroup($contentTypeId $contentTypeId, $contentTypeGroupId $contentTypeGroupId)

Removes the given group from the content type and returns the updated group list.

Parameters

$contentTypeId $contentTypeId
$contentTypeGroupId $contentTypeGroupId

Return Value

ContentTypeGroupRefList

Exceptions

ForbiddenException
NotFoundException