eZPublishCommunityProject  2013.5
eZ\Publish\API\Repository\ContentTypeService Interface Reference
+ Inheritance diagram for eZ\Publish\API\Repository\ContentTypeService:

Public Member Functions

 addFieldDefinition (ContentTypeDraft $contentTypeDraft, FieldDefinitionCreateStruct $fieldDefinitionCreateStruct)
 Adds a new field definition to an existing content type. More...
 
 assignContentTypeGroup (ContentType $contentType, ContentTypeGroup $contentTypeGroup)
 Assigns a content type to a content type group. More...
 
 copyContentType (ContentType $contentType, User $creator=null)
 Copy Type incl fields and groupIds to a new Type object. More...
 
 createContentType (ContentTypeCreateStruct $contentTypeCreateStruct, array $contentTypeGroups)
 Create a Content Type object. More...
 
 createContentTypeDraft (ContentType $contentType)
 Creates a draft from an existing content type. More...
 
 createContentTypeGroup (ContentTypeGroupCreateStruct $contentTypeGroupCreateStruct)
 Create a Content Type Group object. More...
 
 deleteContentType (ContentType $contentType)
 Delete a Content Type object. More...
 
 deleteContentTypeGroup (ContentTypeGroup $contentTypeGroup)
 Delete a Content Type Group. More...
 
 loadContentType ($contentTypeId)
 Get a Content Type object by id. More...
 
 loadContentTypeByIdentifier ($identifier)
 Get a Content Type object by identifier. More...
 
 loadContentTypeByRemoteId ($remoteId)
 Get a Content Type object by id. More...
 
 loadContentTypeDraft ($contentTypeId)
 Get a Content Type object draft by id. More...
 
 loadContentTypeGroup ($contentTypeGroupId)
 Get a Content Type Group object by id. More...
 
 loadContentTypeGroupByIdentifier ($contentTypeGroupIdentifier)
 Get a Content Type Group object by identifier. More...
 
 loadContentTypeGroups ()
 Get all Content Type Groups. More...
 
 loadContentTypes (ContentTypeGroup $contentTypeGroup)
 Get Content Type objects which belong to the given content type group. More...
 
 newContentTypeCreateStruct ($identifier)
 Instantiates a new content type create class. More...
 
 newContentTypeGroupCreateStruct ($identifier)
 Instantiates a new content type group create class. More...
 
 newContentTypeGroupUpdateStruct ()
 Instantiates a new content type update struct. More...
 
 newContentTypeUpdateStruct ()
 Instantiates a new content type update struct. More...
 
 newFieldDefinitionCreateStruct ($identifier, $fieldTypeIdentifier)
 Instantiates a field definition create struct. More...
 
 newFieldDefinitionUpdateStruct ()
 Instantiates a field definition update class. More...
 
 publishContentTypeDraft (ContentTypeDraft $contentTypeDraft)
 Publish the content type and update content objects. More...
 
 removeFieldDefinition (ContentTypeDraft $contentTypeDraft, FieldDefinition $fieldDefinition)
 Remove a field definition from an existing Type. More...
 
 unassignContentTypeGroup (ContentType $contentType, ContentTypeGroup $contentTypeGroup)
 Unassign a content type from a group. More...
 
 updateContentTypeDraft (ContentTypeDraft $contentTypeDraft, ContentTypeUpdateStruct $contentTypeUpdateStruct)
 Update a Content Type object. More...
 
 updateContentTypeGroup (ContentTypeGroup $contentTypeGroup, ContentTypeGroupUpdateStruct $contentTypeGroupUpdateStruct)
 Update a Content Type Group object. More...
 
 updateFieldDefinition (ContentTypeDraft $contentTypeDraft, FieldDefinition $fieldDefinition, FieldDefinitionUpdateStruct $fieldDefinitionUpdateStruct)
 Update a field definition. More...
 

Member Function Documentation

eZ\Publish\API\Repository\ContentTypeService::addFieldDefinition ( ContentTypeDraft  $contentTypeDraft,
FieldDefinitionCreateStruct  $fieldDefinitionCreateStruct 
)

Adds a new field definition to an existing content type.

The content type must be in state DRAFT.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif the identifier in already exists in the content type
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to edit a content type
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft$contentTypeDraft
\eZ\Publish\API\Repository\Values\ContentType\FieldDefinitionCreateStruct$fieldDefinitionCreateStruct

Implemented in eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::assignContentTypeGroup ( ContentType  $contentType,
ContentTypeGroup  $contentTypeGroup 
)

Assigns a content type to a content type group.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to unlink a content type
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf the content type is already assigned the given group
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentType$contentType
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup$contentTypeGroup

Implemented in eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::copyContentType ( ContentType  $contentType,
User  $creator = null 
)

Copy Type incl fields and groupIds to a new Type object.

New Type will have $creator as creator / modifier, created / modified should be updated with current time, updated remoteId and identifier should be appended with '_' + unique string.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the current-user is not allowed to copy a content type
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentType$contentType
\eZ\Publish\API\Repository\Values\User\User$creatorIf null the current-user is used instead
Returns

Implemented in eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::createContentType ( ContentTypeCreateStruct  $contentTypeCreateStruct,
array  $contentTypeGroups 
)

Create a Content Type object.

The content type is created in the state STATUS_DRAFT.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIn case when
  • array of content type groups does not contain at least one content type group
  • identifier or remoteId in the content type create struct already exists
  • there is a duplicate field identifier in the content type create struct
  • content type create struct does not contain at least one field definition create struct
\eZ\Publish\API\Repository\Exceptions\ContentTypeFieldDefinitionValidationExceptionif a field definition in the $contentTypeCreateStruct is not valid
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeCreateStruct$contentTypeCreateStruct
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup[]$contentTypeGroups Required array of ContentTypeGroup to link type with (must contain one)
Returns

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::createContentTypeDraft ( ContentType  $contentType)

Creates a draft from an existing content type.

This is a complete copy of the content type which has the state STATUS_DRAFT.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to edit a content type
\eZ\Publish\API\Repository\Exceptions\BadStateExceptionIf there is already a draft assigned to another user
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentType$contentType
Returns

Implemented in eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::createContentTypeGroup ( ContentTypeGroupCreateStruct  $contentTypeGroupCreateStruct)

Create a Content Type Group object.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to create a content type group
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf a group with the same identifier already exists
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroupCreateStruct$contentTypeGroupCreateStruct
Returns

Implemented in eZ\Publish\Core\REST\Client\ContentTypeService, eZ\Publish\Core\Repository\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::deleteContentType ( ContentType  $contentType)

Delete a Content Type object.

Deletes a content type if it has no instances

Exceptions
\eZ\Publish\API\Repository\Exceptions\BadStateExceptionIf there exist content objects of this type
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to delete a content type
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentType$contentType

Implemented in eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::deleteContentTypeGroup ( ContentTypeGroup  $contentTypeGroup)

Delete a Content Type Group.

This method only deletes an content type group which has content types without any content instances

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to delete a content type group
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf a to be deleted content type has instances
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup$ContentTypeGroup

Implemented in eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::loadContentType (   $contentTypeId)

Get a Content Type object by id.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf a content type with the given id and status DEFINED can not be found
Parameters
int$contentTypeId
Returns

Implemented in eZ\Publish\Core\Repository\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeByIdentifier (   $identifier)

Get a Content Type object by identifier.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf content type with the given identifier and status DEFINED can not be found
Parameters
string$identifier
Returns

Implemented in eZ\Publish\Core\Repository\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeByRemoteId (   $remoteId)

Get a Content Type object by id.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf content type with the given remote id and status DEFINED can not be found
Parameters
string$remoteId
Returns

Implemented in eZ\Publish\Core\Repository\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeDraft (   $contentTypeId)

Get a Content Type object draft by id.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf the content type draft owned by the current user can not be found
Parameters
int$contentTypeId
Returns

Implemented in eZ\Publish\Core\Repository\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeGroup (   $contentTypeGroupId)

Get a Content Type Group object by id.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf group can not be found
Parameters
mixed$contentTypeGroupId
Returns

Implemented in eZ\Publish\Core\Repository\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeGroupByIdentifier (   $contentTypeGroupIdentifier)

Get a Content Type Group object by identifier.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf group can not be found
Parameters
string$contentTypeGroupIdentifier
Returns

Implemented in eZ\Publish\Core\Repository\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeGroups ( )
eZ\Publish\API\Repository\ContentTypeService::loadContentTypes ( ContentTypeGroup  $contentTypeGroup)

Get Content Type objects which belong to the given content type group.

Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup$contentTypeGroup
Returns
[] an array of ContentType which have status DEFINED

Implemented in eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::newContentTypeCreateStruct (   $identifier)

Instantiates a new content type create class.

Parameters
string$identifier
Returns

Implemented in eZ\Publish\Core\Repository\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::newContentTypeGroupCreateStruct (   $identifier)

Instantiates a new content type group create class.

Parameters
string$identifier
Returns

Implemented in eZ\Publish\Core\Repository\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::newContentTypeGroupUpdateStruct ( )
eZ\Publish\API\Repository\ContentTypeService::newContentTypeUpdateStruct ( )
eZ\Publish\API\Repository\ContentTypeService::newFieldDefinitionCreateStruct (   $identifier,
  $fieldTypeIdentifier 
)

Instantiates a field definition create struct.

Parameters
string$fieldTypeIdentifierthe required field type identifier
string$identifierthe required identifier for the field definition
Returns

Implemented in eZ\Publish\Core\Repository\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::newFieldDefinitionUpdateStruct ( )
eZ\Publish\API\Repository\ContentTypeService::publishContentTypeDraft ( ContentTypeDraft  $contentTypeDraft)

Publish the content type and update content objects.

This method updates content objects, depending on the changed field definitions.

Exceptions
\eZ\Publish\API\Repository\Exceptions\BadStateExceptionIf the content type has no draft
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf the content type has no field definitions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to publish a content type
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft$contentTypeDraft

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, and eZ\Publish\Core\REST\Client\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::removeFieldDefinition ( ContentTypeDraft  $contentTypeDraft,
FieldDefinition  $fieldDefinition 
)

Remove a field definition from an existing Type.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf the given field definition does not belong to the given type
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to edit a content type
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft$contentTypeDraft
\eZ\Publish\API\Repository\Values\ContentType\FieldDefinition$fieldDefinition

Implemented in eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::unassignContentTypeGroup ( ContentType  $contentType,
ContentTypeGroup  $contentTypeGroup 
)

Unassign a content type from a group.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to link a content type
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf the content type is not assigned this the given group.
\eZ\Publish\API\Repository\Exceptions\BadStateExceptionIf $contentTypeGroup is the last group assigned to the content type
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentType$contentType
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup$contentTypeGroup

Implemented in eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::updateContentTypeDraft ( ContentTypeDraft  $contentTypeDraft,
ContentTypeUpdateStruct  $contentTypeUpdateStruct 
)

Update a Content Type object.

Does not update fields (fieldDefinitions), use updateFieldDefinition() to update them.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to update a content type
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf the given identifier or remoteId already exists.
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft$contentTypeDraft
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeUpdateStruct$contentTypeUpdateStruct

Implemented in eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::updateContentTypeGroup ( ContentTypeGroup  $contentTypeGroup,
ContentTypeGroupUpdateStruct  $contentTypeGroupUpdateStruct 
)

Update a Content Type Group object.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to create a content type group
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf the given identifier (if set) already exists
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup$contentTypeGroupthe content type group to be updated
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroupUpdateStruct$contentTypeGroupUpdateStruct

Implemented in eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\SignalSlot\ContentTypeService.

eZ\Publish\API\Repository\ContentTypeService::updateFieldDefinition ( ContentTypeDraft  $contentTypeDraft,
FieldDefinition  $fieldDefinition,
FieldDefinitionUpdateStruct  $fieldDefinitionUpdateStruct 
)

Update a field definition.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf the field id in the update struct is not found or does not belong to the content type of If the given identifier is used in an existing field of the given content type
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to edit a content type
Parameters
\eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft$contentTypeDraftthe content type draft
\eZ\Publish\API\Repository\Values\ContentType\FieldDefinition$fieldDefinitionthe field definition which should be updated
\eZ\Publish\API\Repository\Values\ContentType\FieldDefinitionUpdateStruct$fieldDefinitionUpdateStruct

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, and eZ\Publish\Core\REST\Client\ContentTypeService.


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