Methods
Adds a new field definition to an existing content type.
The content type must be in state DRAFT.
Parameters
Tags
-
Throws
-
InvalidArgumentException
if the identifier in already exists in the content type
-
Throws
-
UnauthorizedException
if the user is not allowed to edit a content type
-
Throws
-
ContentTypeFieldDefinitionValidationException
if a field definition in the $contentTypeCreateStruct is not valid
-
Throws
-
BadStateException
If field definition of the same non-repeatable type is being
added to the ContentType that already contains one
or field definition that can't be added to a ContentType that
has Content instances is being added to such ContentType
Assigns a content type to a content type group.
Parameters
Tags
-
Throws
-
UnauthorizedException
if the user is not allowed to unlink a content type
-
Throws
-
InvalidArgumentException
If the content type is already assigned the given group
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.
Parameters
| Name |
Type |
Default value |
Description |
|
$contentType
|
ContentType
|
-
|
-
|
|
$creator
|
User
|
null
|
If null the current-user is used instead
|
Return values
ContentType
Tags
-
Throws
-
UnauthorizedException
if the current-user is not allowed to copy a content type
Create a content type object.
The content type is created in the state STATUS_DRAFT.
Parameters
| Name |
Type |
Default value |
Description |
|
$contentTypeCreateStruct
|
ContentTypeCreateStruct
|
-
|
-
|
|
$contentTypeGroups
|
array<string|int, ContentTypeGroup>
|
-
|
Required array of
ContentTypeGroup to link type with (must contain one)
|
Return values
ContentTypeDraft
Tags
-
Throws
-
UnauthorizedException
if the user is not allowed to create a content type
-
Throws
-
InvalidArgumentException
In 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
-
Throws
-
ContentTypeFieldDefinitionValidationException
if a field definition in the $contentTypeCreateStruct is not valid
Creates a draft from an existing content type.
This is a complete copy of the content
type which has the state STATUS_DRAFT.
Parameters
| Name |
Type |
Default value |
Description |
|
$contentType
|
ContentType
|
-
|
-
|
Return values
ContentTypeDraft
Tags
-
Throws
-
UnauthorizedException
if the user is not allowed to edit a content type
-
Throws
-
BadStateException
If there is already a draft assigned to another user
Create a content type group object.
Parameters
Return values
ContentTypeGroup
Tags
-
Throws
-
UnauthorizedException
if the user is not allowed to create a content type group
-
Throws
-
InvalidArgumentException
If a group with the same identifier already exists
Delete a content type object.
|
|
public deleteContentType(ContentType $contentType) : void
|
Deletes a content type if it has no instances. If content type in state STATUS_DRAFT is
given, only the draft content type will be deleted. Otherwise, if content type in state
STATUS_DEFINED is given, all content type data will be deleted.
Parameters
| Name |
Type |
Default value |
Description |
|
$contentType
|
ContentType
|
-
|
-
|
Tags
-
Throws
-
BadStateException
If there exist content objects of this type
-
Throws
-
UnauthorizedException
if the user is not allowed to delete a content type
Delete a content type group.
This method only deletes an content type group which has content types without any content instances
Parameters
Tags
-
Throws
-
UnauthorizedException
if the user is not allowed to delete a content type group
-
Throws
-
InvalidArgumentException
If a to be deleted content type has instances
Delete all content type drafs created or modified by the user.
|
|
public deleteUserDrafts(int $userId) : void
|
Parameters
| Name |
Type |
Default value |
Description |
|
$userId
|
int
|
-
|
-
|
Parameters
| Name |
Type |
Default value |
Description |
|
$query
|
ContentTypeQuery|null
|
null
|
-
|
|
$prioritizedLanguages
|
array<int, string>
|
[]
|
Used as prioritized language code on translated properties of returned object.
|
Return values
SearchResult
Returns true if the given content type $contentType has content instances.
|
|
public isContentTypeUsed(ContentType $contentType) : bool
|
Parameters
| Name |
Type |
Default value |
Description |
|
$contentType
|
ContentType
|
-
|
-
|
Return values
bool
Get a content type object by id.
|
|
public loadContentType(int $contentTypeId[, array<string|int, string> $prioritizedLanguages = [] ]) : ContentType
|
Parameters
| Name |
Type |
Default value |
Description |
|
$contentTypeId
|
int
|
-
|
-
|
|
$prioritizedLanguages
|
array<string|int, string>
|
[]
|
Used as prioritized language code on translated properties of returned object.
|
Return values
ContentType
Tags
-
Throws
-
NotFoundException
If a content type with the given id and status DEFINED can not be found
Get a content type object by identifier.
|
|
public loadContentTypeByIdentifier(string $identifier[, array<string|int, string> $prioritizedLanguages = [] ]) : ContentType
|
Parameters
| Name |
Type |
Default value |
Description |
|
$identifier
|
string
|
-
|
-
|
|
$prioritizedLanguages
|
array<string|int, string>
|
[]
|
Used as prioritized language code on translated properties of returned object.
|
Return values
ContentType
Tags
-
Throws
-
NotFoundException
If content type with the given identifier and status DEFINED can not be found
Get a content type object by id.
|
|
public loadContentTypeByRemoteId(string $remoteId[, array<string|int, string> $prioritizedLanguages = [] ]) : ContentType
|
Parameters
| Name |
Type |
Default value |
Description |
|
$remoteId
|
string
|
-
|
-
|
|
$prioritizedLanguages
|
array<string|int, string>
|
[]
|
Used as prioritized language code on translated properties of returned object.
|
Return values
ContentType
Tags
-
Throws
-
NotFoundException
If content type with the given remote id and status DEFINED can not be found
Get a content type object draft by id.
|
|
public loadContentTypeDraft(int $contentTypeId[, bool $ignoreOwnership = false ]) : ContentTypeDraft
|
Parameters
| Name |
Type |
Default value |
Description |
|
$contentTypeId
|
int
|
-
|
-
|
|
$ignoreOwnership
|
bool
|
false
|
if true, method will return draft even if the owner is different than currently logged in user
|
Return values
ContentTypeDraft
Tags
-
Throws
-
NotFoundException
If the content type draft owned by the current user can not be found
Get a content type group object by id.
|
|
public loadContentTypeGroup(int $contentTypeGroupId[, array<string|int, string> $prioritizedLanguages = [] ]) : ContentTypeGroup
|
Parameters
| Name |
Type |
Default value |
Description |
|
$contentTypeGroupId
|
int
|
-
|
-
|
|
$prioritizedLanguages
|
array<string|int, string>
|
[]
|
Used as prioritized language code on translated properties of returned object.
|
Return values
ContentTypeGroup
Tags
-
Throws
-
NotFoundException
If group can not be found
Get a content type group object by identifier.
|
|
public loadContentTypeGroupByIdentifier(string $contentTypeGroupIdentifier[, array<string|int, string> $prioritizedLanguages = [] ]) : ContentTypeGroup
|
Parameters
| Name |
Type |
Default value |
Description |
|
$contentTypeGroupIdentifier
|
string
|
-
|
-
|
|
$prioritizedLanguages
|
array<string|int, string>
|
[]
|
Used as prioritized language code on translated properties of returned object.
|
Return values
ContentTypeGroup
Tags
-
Throws
-
NotFoundException
If group can not be found
Get all content type groups.
|
|
public loadContentTypeGroups([array<string|int, string> $prioritizedLanguages = [] ]) : array<string|int, ContentTypeGroup>
|
Parameters
| Name |
Type |
Default value |
Description |
|
$prioritizedLanguages
|
array<string|int, string>
|
[]
|
Used as prioritized language code on translated properties of returned object.
|
Return values
array<string|int, ContentTypeGroup>
Bulk-load content type objects by ids.
|
|
public loadContentTypeList(array<string|int, int> $contentTypeIds[, array<string|int, string> $prioritizedLanguages = [] ]) : array<string|int, ContentType>|iterable<string|int, mixed>
|
Note: it does not throw exceptions on load, just ignores erroneous items.
Parameters
| Name |
Type |
Default value |
Description |
|
$contentTypeIds
|
array<string|int, int>
|
-
|
-
|
|
$prioritizedLanguages
|
array<string|int, string>
|
[]
|
Used as prioritized language code on translated properties of returned object.
|
Return values
array<string|int, ContentType>|iterable<string|int, mixed>
Get content type objects which belong to the given content type group.
|
|
public loadContentTypes(ContentTypeGroup $contentTypeGroup[, array<string|int, string> $prioritizedLanguages = [] ]) : array<string|int, ContentType>
|
Parameters
| Name |
Type |
Default value |
Description |
|
$contentTypeGroup
|
ContentTypeGroup
|
-
|
-
|
|
$prioritizedLanguages
|
array<string|int, string>
|
[]
|
Used as prioritized language code on translated properties of returned object.
|
Return values
array<string|int, ContentType>
Instantiates a new content type create class.
Parameters
| Name |
Type |
Default value |
Description |
|
$identifier
|
string
|
-
|
-
|
Return values
ContentTypeCreateStruct
Instantiates a new content type group create class.
Parameters
| Name |
Type |
Default value |
Description |
|
$identifier
|
string
|
-
|
-
|
Return values
ContentTypeGroupCreateStruct
Instantiates a new content type update struct.
Return values
ContentTypeGroupUpdateStruct
Instantiates a new content type update struct.
Return values
ContentTypeUpdateStruct
Instantiates a field definition create struct.
Parameters
| Name |
Type |
Default value |
Description |
|
$identifier
|
string
|
-
|
the required identifier for the field definition
|
|
$fieldTypeIdentifier
|
string
|
-
|
the required field type identifier
|
Return values
FieldDefinitionCreateStruct
Instantiates a field definition update class.
Return values
FieldDefinitionUpdateStruct
Publish the content type and update content objects.
This method updates content objects, depending on the changed field definitions.
Parameters
Tags
-
Throws
-
BadStateException
If the content type has no draft
-
Throws
-
InvalidArgumentException
If the content type has no field definitions
-
Throws
-
UnauthorizedException
if the user is not allowed to publish a content type
Parameters
| Name |
Type |
Default value |
Description |
|
$contentTypeDraft
|
ContentTypeDraft
|
-
|
-
|
|
$languageCode
|
string
|
-
|
-
|
Return values
ContentTypeDraft
Remove a field definition from an existing Type.
Parameters
Tags
-
Throws
-
InvalidArgumentException
If the given field definition does not belong to the given type
-
Throws
-
UnauthorizedException
if the user is not allowed to edit a content type
Unassign a content type from a group.
Parameters
Tags
-
Throws
-
UnauthorizedException
if the user is not allowed to link a content type
-
Throws
-
InvalidArgumentException
If the content type is not assigned this the given group.
-
Throws
-
BadStateException
If $contentTypeGroup is the last group assigned to the content type
Update a content type object.
Parameters
Tags
-
Throws
-
UnauthorizedException
if the user is not allowed to update a content type
-
Throws
-
InvalidArgumentException
If the given identifier or remoteId already exists.
Update a content type group object.
Parameters
Tags
-
Throws
-
UnauthorizedException
if the user is not allowed to create a content type group
-
Throws
-
InvalidArgumentException
If the given identifier (if set) already exists
Update a field definition.
Parameters
Tags
-
Throws
-
InvalidArgumentException
If 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
-
Throws
-
UnauthorizedException
if the user is not allowed to edit a content type