eZPublishCommunityProject  2013.9
eZ\Publish\Core\REST\Server\Controller\ContentType Class Reference

ContentType controller. More...

+ Inheritance diagram for eZ\Publish\Core\REST\Server\Controller\ContentType:
+ Collaboration diagram for eZ\Publish\Core\REST\Server\Controller\ContentType:

Public Member Functions

 __construct (ContentTypeService $contentTypeService)
 Construct controller. More...
 
 addContentTypeDraftFieldDefinition ($contentTypeId)
 Creates a new field definition for the given content type draft. More...
 
 copyContentType ($contentTypeId)
 Copies a content type. More...
 
 createContentType ($contentTypeGroupId)
 Creates a new content type draft in the given content type group. More...
 
 createContentTypeDraft ($contentTypeId)
 Creates a draft and updates it with the given data. More...
 
 createContentTypeGroup ()
 Creates a new content type group. More...
 
 deleteContentType ($contentTypeId)
 The given content type is deleted. More...
 
 deleteContentTypeDraft ($contentTypeId)
 The given content type draft is deleted. More...
 
 deleteContentTypeGroup ($contentTypeGroupId)
 The given content type group is deleted. More...
 
 linkContentTypeToGroup ($contentTypeId)
 Links a content type group to the content type and returns the updated group list. More...
 
 listContentTypes ()
 Returns a list of content types. More...
 
 listContentTypesForGroup ($contentTypeGroupId)
 Returns a list of content types of the group. More...
 
 loadContentType ($contentTypeId)
 Loads a content type. More...
 
 loadContentTypeByIdentifier ()
 Loads a content type by its identifier. More...
 
 loadContentTypeByRemoteId ()
 Loads a content type by its remote ID. More...
 
 loadContentTypeDraft ($contentTypeId)
 Loads a content type draft. More...
 
 loadContentTypeDraftFieldDefinition ($contentTypeId, $fieldDefinitionId)
 Returns the draft field definition given by id. More...
 
 loadContentTypeDraftFieldDefinitionList ($contentTypeId)
 Loads field definitions for a given content type draft. More...
 
 loadContentTypeFieldDefinition ($contentTypeId, $fieldDefinitionId)
 Returns the field definition given by id. More...
 
 loadContentTypeFieldDefinitionList ($contentTypeId)
 Loads field definitions for a given content type. More...
 
 loadContentTypeGroup ($contentTypeGroupId)
 Returns the content type group given by id. More...
 
 loadContentTypeGroupList ()
 Returns a list of all content type groups. More...
 
 loadGroupsOfContentType ($contentTypeId)
 Returns the content type groups the content type belongs to. More...
 
 publishContentTypeDraft ($contentTypeId)
 Publishes a content type draft. More...
 
 removeContentTypeDraftFieldDefinition ($contentTypeId, $fieldDefinitionId)
 Deletes a field definition from a content type draft. More...
 
 unlinkContentTypeFromGroup ($contentTypeId, $contentTypeGroupId)
 Removes the given group from the content type and returns the updated group list. More...
 
 updateContentTypeDraft ($contentTypeId)
 Updates meta data of a draft. More...
 
 updateContentTypeDraftFieldDefinition ($contentTypeId, $fieldDefinitionId)
 Updates the attributes of a field definition. More...
 
 updateContentTypeGroup ($contentTypeGroupId)
 Updates a content type group. More...
 
- Public Member Functions inherited from eZ\Publish\Core\REST\Server\Controller
 setContainer (Container $container)
 
 setInputDispatcher (InputDispatcher $inputDispatcher)
 
 setRepository (Repository $repository)
 
 setRequest (Request $request=null)
 
 setRequestParser (RequestParser $requestParser)
 
 setRouter (RouterInterface $router)
 

Protected Attributes

 $contentTypeService
 
- Protected Attributes inherited from eZ\Publish\Core\REST\Server\Controller
 $container
 
 $inputDispatcher
 
 $repository
 
 $request
 
 $requestParser
 
 $router
 

Private Member Functions

 mapToGroupUpdateStruct (ContentTypeGroupCreateStruct $createStruct)
 Converts the provided ContentTypeGroupCreateStruct to ContentTypeGroupUpdateStruct. More...
 

Additional Inherited Members

- Protected Member Functions inherited from eZ\Publish\Core\REST\Server\Controller
 getMediaType ()
 Extracts the requested media type from $request. More...
 

Detailed Description

ContentType controller.

Constructor & Destructor Documentation

eZ\Publish\Core\REST\Server\Controller\ContentType::__construct ( ContentTypeService  $contentTypeService)

Construct controller.

Parameters
\eZ\Publish\API\Repository\ContentTypeService$contentTypeService

Member Function Documentation

eZ\Publish\Core\REST\Server\Controller\ContentType::addContentTypeDraftFieldDefinition (   $contentTypeId)

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

Parameters
$contentTypeId
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::copyContentType (   $contentTypeId)

Copies a content type.

The identifier of the copy is changed to copy_of_<identifier> and a new remoteId is generated.

Parameters
$contentTypeId
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::createContentType (   $contentTypeGroupId)

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

Parameters
$contentTypeGroupId
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
\eZ\Publish\Core\REST\Server\Exceptions\BadRequestException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::createContentTypeDraft (   $contentTypeId)

Creates a draft and updates it with the given data.

Parameters
$contentTypeId
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::createContentTypeGroup ( )

Creates a new content type group.

Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::deleteContentType (   $contentTypeId)

The given content type is deleted.

Parameters
$contentTypeId
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::deleteContentTypeDraft (   $contentTypeId)

The given content type draft is deleted.

Parameters
$contentTypeId
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::deleteContentTypeGroup (   $contentTypeGroupId)

The given content type group is deleted.

Parameters
mixed$contentTypeGroupId
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::linkContentTypeToGroup (   $contentTypeId)

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

Parameters
mixed$contentTypeId
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
\eZ\Publish\Core\REST\Server\Exceptions\BadRequestException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::listContentTypes ( )

Returns a list of content types.

Returns
|
eZ\Publish\Core\REST\Server\Controller\ContentType::listContentTypesForGroup (   $contentTypeGroupId)

Returns a list of content types of the group.

Parameters
string$contentTypeGroupId
Returns
|
eZ\Publish\Core\REST\Server\Controller\ContentType::loadContentType (   $contentTypeId)

Loads a content type.

Parameters
$contentTypeId
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::loadContentTypeByIdentifier ( )

Loads a content type by its identifier.

Returns

Referenced by eZ\Publish\Core\REST\Server\Controller\ContentType\listContentTypes().

eZ\Publish\Core\REST\Server\Controller\ContentType::loadContentTypeByRemoteId ( )

Loads a content type by its remote ID.

Returns

Referenced by eZ\Publish\Core\REST\Server\Controller\ContentType\listContentTypes().

eZ\Publish\Core\REST\Server\Controller\ContentType::loadContentTypeDraft (   $contentTypeId)

Loads a content type draft.

Parameters
$contentTypeId
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::loadContentTypeDraftFieldDefinition (   $contentTypeId,
  $fieldDefinitionId 
)

Returns the draft field definition given by id.

Parameters
$contentTypeId
$fieldDefinitionId
Exceptions
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::loadContentTypeDraftFieldDefinitionList (   $contentTypeId)

Loads field definitions for a given content type draft.

Parameters
$contentTypeId
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::loadContentTypeFieldDefinition (   $contentTypeId,
  $fieldDefinitionId 
)

Returns the field definition given by id.

Parameters
$contentTypeId
$fieldDefinitionId
Exceptions
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::loadContentTypeFieldDefinitionList (   $contentTypeId)

Loads field definitions for a given content type.

Parameters
$contentTypeId
Returns
Todo:
Check why this isn't in the specs
eZ\Publish\Core\REST\Server\Controller\ContentType::loadContentTypeGroup (   $contentTypeGroupId)

Returns the content type group given by id.

Parameters
$contentTypeGroupId
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::loadContentTypeGroupList ( )

Returns a list of all content type groups.

Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::loadGroupsOfContentType (   $contentTypeId)

Returns the content type groups the content type belongs to.

Parameters
$contentTypeId
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::mapToGroupUpdateStruct ( ContentTypeGroupCreateStruct  $createStruct)
private

Converts the provided ContentTypeGroupCreateStruct to ContentTypeGroupUpdateStruct.

Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroupCreateStruct$createStruct
Returns

Referenced by eZ\Publish\Core\REST\Server\Controller\ContentType\updateContentTypeGroup().

eZ\Publish\Core\REST\Server\Controller\ContentType::publishContentTypeDraft (   $contentTypeId)

Publishes a content type draft.

Parameters
$contentTypeId
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::removeContentTypeDraftFieldDefinition (   $contentTypeId,
  $fieldDefinitionId 
)

Deletes a field definition from a content type draft.

Parameters
$contentTypeId
$fieldDefinitionId
Exceptions
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::unlinkContentTypeFromGroup (   $contentTypeId,
  $contentTypeGroupId 
)

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

Parameters
$contentTypeId
$contentTypeGroupId
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::updateContentTypeDraft (   $contentTypeId)

Updates meta data of a draft.

This method does not handle field definitions

Parameters
$contentTypeId
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::updateContentTypeDraftFieldDefinition (   $contentTypeId,
  $fieldDefinitionId 
)

Updates the attributes of a field definition.

Parameters
$contentTypeId
$fieldDefinitionId
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\ContentType::updateContentTypeGroup (   $contentTypeGroupId)

Updates a content type group.

Parameters
$contentTypeGroupId
Exceptions
\eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException
Returns

Member Data Documentation

eZ\Publish\Core\REST\Server\Controller\ContentType::$contentTypeService
protected

The documentation for this class was generated from the following file: