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

Inheritance: extends eZ\Publish\Core\REST\Server\Controller
ファイルを表示 Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$contentTypeService eZ\Publish\API\Repository\ContentTypeService Content type service.

Public Methods

Method Description
__construct ( eZ\Publish\API\Repository\ContentTypeService $contentTypeService ) Construct controller.
addContentTypeDraftFieldDefinition ( $contentTypeId, Request $request ) : CreatedFieldDefinition Creates a new field definition for the given content type draft.
copyContentType ( $contentTypeId ) : ResourceCreated Copies a content type. The identifier of the copy is changed to copy_of__ and a new remoteId is generated.
createContentType ( $contentTypeGroupId, Request $request ) : CreatedContentType Creates a new content type draft in the given content type group.
createContentTypeDraft ( $contentTypeId, Request $request ) : CreatedContentType Creates a draft and updates it with the given data.
createContentTypeGroup ( Request $request ) : CreatedContentTypeGroup Creates a new content type group.
deleteContentType ( $contentTypeId ) : eZ\Publish\Core\REST\Server\Values\NoContent The given content type is deleted.
deleteContentTypeDraft ( $contentTypeId ) : eZ\Publish\Core\REST\Server\Values\NoContent The given content type draft is deleted.
deleteContentTypeGroup ( mixed $contentTypeGroupId ) : eZ\Publish\Core\REST\Server\Values\NoContent The given content type group is deleted.
linkContentTypeToGroup ( mixed $contentTypeId, Request $request ) : ContentTypeGroupRefList Links a content type group to the content type and returns the updated group list.
listContentTypes ( Request $request ) : ContentTypeList | ContentTypeInfoList Returns a list of content types.
listContentTypesForGroup ( string $contentTypeGroupId, Request $request ) : ContentTypeList | ContentTypeInfoList Returns a list of content types of the group.
loadContentType ( $contentTypeId ) : RestContentType Loads a content type.
loadContentTypeByIdentifier ( Request $request ) : eZ\Publish\API\Repository\Values\ContentType\ContentType Loads a content type by its identifier.
loadContentTypeByRemoteId ( Request $request ) : eZ\Publish\API\Repository\Values\ContentType\ContentType Loads a content type by its remote ID.
loadContentTypeDraft ( $contentTypeId ) : RestContentType Loads a content type draft.
loadContentTypeDraftFieldDefinition ( $contentTypeId, $fieldDefinitionId, Request $request ) : RestFieldDefinition Returns the draft field definition given by id.
loadContentTypeDraftFieldDefinitionList ( $contentTypeId ) : FieldDefinitionList Loads field definitions for a given content type draft.
loadContentTypeFieldDefinition ( $contentTypeId, $fieldDefinitionId, Request $request ) : RestFieldDefinition Returns the field definition given by id.
loadContentTypeFieldDefinitionList ( $contentTypeId ) : FieldDefinitionList Loads field definitions for a given content type.
loadContentTypeGroup ( $contentTypeGroupId ) : eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup Returns the content type group given by id.
loadContentTypeGroupList ( Request $request ) : ContentTypeGroupList Returns a list of all content type groups.
loadGroupsOfContentType ( $contentTypeId ) : ContentTypeGroupRefList Returns the content type groups the content type belongs to.
publishContentTypeDraft ( $contentTypeId ) : RestContentType Publishes a content type draft.
removeContentTypeDraftFieldDefinition ( $contentTypeId, $fieldDefinitionId, Request $request ) : eZ\Publish\Core\REST\Server\Values\NoContent Deletes a field definition from a content type draft.
unlinkContentTypeFromGroup ( $contentTypeId, $contentTypeGroupId ) : ContentTypeGroupRefList Removes the given group from the content type and returns the updated group list.
updateContentTypeDraft ( $contentTypeId, Request $request ) : RestContentType Updates meta data of a draft. This method does not handle field definitions.
updateContentTypeDraftFieldDefinition ( $contentTypeId, $fieldDefinitionId, Request $request ) : FieldDefinitionList Updates the attributes of a field definition.
updateContentTypeGroup ( $contentTypeGroupId, Request $request ) : eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup Updates a content type group.

Protected Methods

Method Description
getContentTypeList ( ) : ContentType[]
sortContentTypeList ( array &$contentTypes, string $orderby, $sort = 'asc' ) : mixed

Private Methods

Method Description
mapToGroupUpdateStruct ( eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroupCreateStruct $createStruct ) : eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroupUpdateStruct Converts the provided ContentTypeGroupCreateStruct to ContentTypeGroupUpdateStruct.

Method Details

__construct() public method

Construct controller.
public __construct ( eZ\Publish\API\Repository\ContentTypeService $contentTypeService )
$contentTypeService eZ\Publish\API\Repository\ContentTypeService

addContentTypeDraftFieldDefinition() public method

Creates a new field definition for the given content type draft.
public addContentTypeDraftFieldDefinition ( $contentTypeId, Request $request ) : CreatedFieldDefinition
$contentTypeId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\CreatedFieldDefinition

copyContentType() public method

Copies a content type. The identifier of the copy is changed to copy_of__ and a new remoteId is generated.
public copyContentType ( $contentTypeId ) : ResourceCreated
$contentTypeId
return eZ\Publish\Core\REST\Server\Values\ResourceCreated

createContentType() public method

Creates a new content type draft in the given content type group.
public createContentType ( $contentTypeGroupId, Request $request ) : CreatedContentType
$contentTypeGroupId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\CreatedContentType

createContentTypeDraft() public method

Creates a draft and updates it with the given data.
public createContentTypeDraft ( $contentTypeId, Request $request ) : CreatedContentType
$contentTypeId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\CreatedContentType

createContentTypeGroup() public method

Creates a new content type group.
public createContentTypeGroup ( Request $request ) : CreatedContentTypeGroup
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\CreatedContentTypeGroup

deleteContentType() public method

The given content type is deleted.
public deleteContentType ( $contentTypeId ) : eZ\Publish\Core\REST\Server\Values\NoContent
$contentTypeId
return eZ\Publish\Core\REST\Server\Values\NoContent

deleteContentTypeDraft() public method

The given content type draft is deleted.
public deleteContentTypeDraft ( $contentTypeId ) : eZ\Publish\Core\REST\Server\Values\NoContent
$contentTypeId
return eZ\Publish\Core\REST\Server\Values\NoContent

deleteContentTypeGroup() public method

The given content type group is deleted.
public deleteContentTypeGroup ( mixed $contentTypeGroupId ) : eZ\Publish\Core\REST\Server\Values\NoContent
$contentTypeGroupId mixed
return eZ\Publish\Core\REST\Server\Values\NoContent

getContentTypeList() protected method

protected getContentTypeList ( ) : ContentType[]
return ContentType[]

linkContentTypeToGroup() public method

Links a content type group to the content type and returns the updated group list.
public linkContentTypeToGroup ( mixed $contentTypeId, Request $request ) : ContentTypeGroupRefList
$contentTypeId mixed
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\ContentTypeGroupRefList

listContentTypes() public method

Returns a list of content types.
public listContentTypes ( Request $request ) : ContentTypeList | ContentTypeInfoList
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\ContentTypeList | eZ\Publish\Core\REST\Server\Values\ContentTypeInfoList

listContentTypesForGroup() public method

Returns a list of content types of the group.
public listContentTypesForGroup ( string $contentTypeGroupId, Request $request ) : ContentTypeList | ContentTypeInfoList
$contentTypeGroupId string
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\ContentTypeList | eZ\Publish\Core\REST\Server\Values\ContentTypeInfoList

loadContentType() public method

Loads a content type.
public loadContentType ( $contentTypeId ) : RestContentType
$contentTypeId
return eZ\Publish\Core\REST\Server\Values\RestContentType

loadContentTypeByIdentifier() public method

Loads a content type by its identifier.
public loadContentTypeByIdentifier ( Request $request ) : eZ\Publish\API\Repository\Values\ContentType\ContentType
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\API\Repository\Values\ContentType\ContentType

loadContentTypeByRemoteId() public method

Loads a content type by its remote ID.
public loadContentTypeByRemoteId ( Request $request ) : eZ\Publish\API\Repository\Values\ContentType\ContentType
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\API\Repository\Values\ContentType\ContentType

loadContentTypeDraft() public method

Loads a content type draft.
public loadContentTypeDraft ( $contentTypeId ) : RestContentType
$contentTypeId
return eZ\Publish\Core\REST\Server\Values\RestContentType

loadContentTypeDraftFieldDefinition() public method

Returns the draft field definition given by id.
public loadContentTypeDraftFieldDefinition ( $contentTypeId, $fieldDefinitionId, Request $request ) : RestFieldDefinition
$contentTypeId
$fieldDefinitionId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\RestFieldDefinition

loadContentTypeDraftFieldDefinitionList() public method

Loads field definitions for a given content type draft.
public loadContentTypeDraftFieldDefinitionList ( $contentTypeId ) : FieldDefinitionList
$contentTypeId
return eZ\Publish\Core\REST\Server\Values\FieldDefinitionList

loadContentTypeFieldDefinition() public method

Returns the field definition given by id.
public loadContentTypeFieldDefinition ( $contentTypeId, $fieldDefinitionId, Request $request ) : RestFieldDefinition
$contentTypeId
$fieldDefinitionId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\RestFieldDefinition

loadContentTypeFieldDefinitionList() public method

Loads field definitions for a given content type.
public loadContentTypeFieldDefinitionList ( $contentTypeId ) : FieldDefinitionList
$contentTypeId
return eZ\Publish\Core\REST\Server\Values\FieldDefinitionList

loadContentTypeGroup() public method

Returns the content type group given by id.
public loadContentTypeGroup ( $contentTypeGroupId ) : eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup
$contentTypeGroupId
return eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup

loadContentTypeGroupList() public method

Returns a list of all content type groups.
public loadContentTypeGroupList ( Request $request ) : ContentTypeGroupList
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\ContentTypeGroupList

loadGroupsOfContentType() public method

Returns the content type groups the content type belongs to.
public loadGroupsOfContentType ( $contentTypeId ) : ContentTypeGroupRefList
$contentTypeId
return eZ\Publish\Core\REST\Server\Values\ContentTypeGroupRefList

publishContentTypeDraft() public method

Publishes a content type draft.
public publishContentTypeDraft ( $contentTypeId ) : RestContentType
$contentTypeId
return eZ\Publish\Core\REST\Server\Values\RestContentType

removeContentTypeDraftFieldDefinition() public method

Deletes a field definition from a content type draft.
public removeContentTypeDraftFieldDefinition ( $contentTypeId, $fieldDefinitionId, Request $request ) : eZ\Publish\Core\REST\Server\Values\NoContent
$contentTypeId
$fieldDefinitionId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\NoContent

sortContentTypeList() protected method

protected sortContentTypeList ( array &$contentTypes, string $orderby, $sort = 'asc' ) : mixed
$contentTypes array
$orderby string
return mixed

unlinkContentTypeFromGroup() public method

Removes the given group from the content type and returns the updated group list.
public unlinkContentTypeFromGroup ( $contentTypeId, $contentTypeGroupId ) : ContentTypeGroupRefList
$contentTypeId
$contentTypeGroupId
return eZ\Publish\Core\REST\Server\Values\ContentTypeGroupRefList

updateContentTypeDraft() public method

Updates meta data of a draft. This method does not handle field definitions.
public updateContentTypeDraft ( $contentTypeId, Request $request ) : RestContentType
$contentTypeId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\RestContentType

updateContentTypeDraftFieldDefinition() public method

Updates the attributes of a field definition.
public updateContentTypeDraftFieldDefinition ( $contentTypeId, $fieldDefinitionId, Request $request ) : FieldDefinitionList
$contentTypeId
$fieldDefinitionId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\FieldDefinitionList

updateContentTypeGroup() public method

Updates a content type group.
public updateContentTypeGroup ( $contentTypeGroupId, Request $request ) : eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup
$contentTypeGroupId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup

Property Details

$contentTypeService protected_oe property

Content type service.
protected ContentTypeService,eZ\Publish\API\Repository $contentTypeService
return eZ\Publish\API\Repository\ContentTypeService