Methods
Adds a new field definition to an existing Type.
This method creates a new version of the Type with the $fieldDefinition
added. It does not update existing content objects depending on the
field (default) values.
Parameters
Name |
Type |
Default value |
Description |
$contentTypeId
|
mixed
|
-
|
-
|
$status
|
int
|
-
|
One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
|
$fieldDefinition
|
FieldDefinition
|
-
|
-
|
Return values
FieldDefinition
Tags
-
Throws
-
NotFoundException
Copy a Type to a new Type with status Draft.
|
public copy(mixed $userId, mixed $contentTypeId, int $status) : Type
|
Copy a Type incl fields and group-relations from a given status to a new Type with status Type::STATUS_DRAFT.
New content type will have $userId as creator / modifier, created / modified should be updated, new remoteId created
and identifier should be 'copy_of_<originalBaseIdentifier>_<newTypeId>' or another unique string.
Parameters
Name |
Type |
Default value |
Description |
$userId
|
mixed
|
-
|
-
|
$contentTypeId
|
mixed
|
-
|
-
|
$status
|
int
|
-
|
One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
|
Return values
Type
Tags
-
Throws
-
NotFoundException
If user or type with provided status is not found
Parameters
Name |
Type |
Default value |
Description |
$contentType
|
CreateStruct
|
-
|
-
|
Return values
Type
Creates a draft of existing defined content type.
|
public createDraft(mixed $modifierId, mixed $contentTypeId) : Type
|
Updates modified date, sets $modifierId and status to Type::STATUS_DRAFT on the new returned draft.
Parameters
Name |
Type |
Default value |
Description |
$modifierId
|
mixed
|
-
|
-
|
$contentTypeId
|
mixed
|
-
|
-
|
Return values
Type
Tags
-
Throws
-
NotFoundException
If type with defined status is not found
Parameters
Return values
Group
|
public delete(mixed $contentTypeId, int $status) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$contentTypeId
|
mixed
|
-
|
-
|
$status
|
int
|
-
|
One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
|
Tags
-
Throws
-
BadStateException
If type is defined and still has content
|
public deleteByUserAndStatus(int $userId, int $status) : void
|
Parameters
Name |
Type |
Default value |
Description |
$userId
|
int
|
-
|
-
|
$status
|
int
|
-
|
-
|
|
public deleteGroup(mixed $groupId) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$groupId
|
mixed
|
-
|
-
|
Tags
-
Throws
-
BadStateException
If type group contains types
-
Throws
-
NotFoundException
If type group with id is not found
Counts the number of Content instances of the ContentType identified by given $contentTypeId.
|
public getContentCount(mixed $contentTypeId) : int
|
Parameters
Name |
Type |
Default value |
Description |
$contentTypeId
|
mixed
|
-
|
-
|
Return values
int
Returns field definition for the given field definition id.
Parameters
Name |
Type |
Default value |
Description |
$id
|
mixed
|
-
|
-
|
$status
|
int
|
-
|
One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
|
Return values
FieldDefinition
Tags
-
Throws
-
NotFoundException
If field definition is not found
Returns content type, field definition and field type mapping information
for search engine usage. Only searchable field definitions will be included
in the returned data.
|
public getSearchableFieldMap() : array<string|int, mixed>
|
Returns an array in the form:
array(
"" => array(
"" => array(
"field_definition_id" => "",
"field_type_identifier" => "",
),
...
),
...
)
Return values
array<string|int, mixed>
Link a content type group with a content type.
|
public link(mixed $groupId, mixed $contentTypeId, int $status) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$groupId
|
mixed
|
-
|
-
|
$contentTypeId
|
mixed
|
-
|
-
|
$status
|
int
|
-
|
One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
|
Tags
-
Throws
-
NotFoundException
If group or type with provided status is not found
-
Throws
-
BadStateException
If type is already part of group
Loads a content type by id and status.
|
public load(mixed $contentTypeId[, int $status = Type::STATUS_DEFINED ]) : Type
|
Note: This method is responsible of having the Field Definitions of the loaded ContentType sorted by placement.
Parameters
Name |
Type |
Default value |
Description |
$contentTypeId
|
mixed
|
-
|
-
|
$status
|
int
|
Type::STATUS_DEFINED
|
One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
|
Return values
Type
Tags
-
Throws
-
NotFoundException
If type with provided status is not found
|
public loadAllGroups() : array<string|int, Group>
|
Return values
array<string|int, Group>
Loads a (defined) content type by identifier.
|
public loadByIdentifier(string $identifier) : Type
|
Note: This method is responsible of having the Field Definitions of the loaded ContentType sorted by placement.
Parameters
Name |
Type |
Default value |
Description |
$identifier
|
string
|
-
|
-
|
Return values
Type
Tags
-
Throws
-
NotFoundException
If defined type is not found
Loads a (defined) content type by remote id.
|
public loadByRemoteId(mixed $remoteId) : Type
|
Note: This method is responsible of having the Field Definitions of the loaded ContentType sorted by placement.
Parameters
Name |
Type |
Default value |
Description |
$remoteId
|
mixed
|
-
|
-
|
Return values
Type
Tags
-
Throws
-
NotFoundException
If defined type is not found
Return list of unique content types, with type id as key.
|
public loadContentTypeList(array<string|int, mixed> $contentTypeIds) : array<string|int, Type>
|
Missing items (NotFound) will be missing from the array and not cause an exception, it's up
to calling logic to determine if this should cause exception or not.
Parameters
Name |
Type |
Default value |
Description |
$contentTypeIds
|
array<string|int, mixed>
|
-
|
-
|
Return values
array<string|int, Type>
|
public loadContentTypes(mixed $groupId[, int $status = Type::STATUS_DEFINED ]) : array<string|int, Type>
|
Parameters
Name |
Type |
Default value |
Description |
$groupId
|
mixed
|
-
|
-
|
$status
|
int
|
Type::STATUS_DEFINED
|
One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
|
Return values
array<string|int, Type>
|
public loadContentTypesByFieldDefinitionIdentifier(string $identifier) : array<string|int, Type>
|
Parameters
Name |
Type |
Default value |
Description |
$identifier
|
string
|
-
|
-
|
Return values
array<string|int, Type>
|
public loadGroup(mixed $groupId) : Group
|
Parameters
Name |
Type |
Default value |
Description |
$groupId
|
mixed
|
-
|
-
|
Return values
Group
Tags
-
Throws
-
NotFoundException
If type group with id is not found
Loads Type Group by identifier.
|
public loadGroupByIdentifier(string $identifier) : Group
|
Legacy note: Uses name for identifier.
Parameters
Name |
Type |
Default value |
Description |
$identifier
|
string
|
-
|
-
|
Return values
Group
Tags
-
Throws
-
NotFoundException
If type group with id is not found
Return list of unique content type groups, with group id as key.
|
public loadGroups(array<string|int, mixed> $groupIds) : array<string|int, Group>
|
Missing items (NotFound) will be missing from the array and not cause an exception, it's up
to calling logic to determine if this should cause exception or not.
Parameters
Name |
Type |
Default value |
Description |
$groupIds
|
array<string|int, mixed>
|
-
|
-
|
Return values
array<string|int, Group>
Update content objects.
|
public publish(mixed $contentTypeId) : mixed
|
Updates content objects, depending on the changed field definitions.
A content type has a state which tells if its content objects yet have
been adapted.
Flags the content type as updated.
Parameters
Name |
Type |
Default value |
Description |
$contentTypeId
|
mixed
|
-
|
-
|
Tags
-
Throws
-
NotFoundException
If type with $contentTypeId and Type::STATUS_DRAFT is not found
|
public removeContentTypeTranslation(int $contentTypeId, string $languageCode) : Type
|
Parameters
Name |
Type |
Default value |
Description |
$contentTypeId
|
int
|
-
|
-
|
$languageCode
|
string
|
-
|
-
|
Return values
Type
Removes a field definition from an existing Type.
|
public removeFieldDefinition(mixed $contentTypeId, int $status, FieldDefinition $fieldDefinition) : void
|
This method creates a new version of the Type with the field definition
referred to by $fieldDefinitionId removed. It does not update existing
content objects depending on the field (default) values.
Parameters
Name |
Type |
Default value |
Description |
$contentTypeId
|
mixed
|
-
|
-
|
$status
|
int
|
-
|
One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
|
$fieldDefinition
|
FieldDefinition
|
-
|
-
|
Tags
-
Throws
-
NotFoundException
Unlink a content type group from a content type.
|
public unlink(mixed $groupId, mixed $contentTypeId, int $status) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$groupId
|
mixed
|
-
|
-
|
$contentTypeId
|
mixed
|
-
|
-
|
$status
|
int
|
-
|
One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
|
Tags
-
Throws
-
NotFoundException
If group or type with provided status is not found
-
Throws
-
BadStateException
If $groupId is last group on $contentTypeId or
not a group assigned to type
|
public update(mixed $contentTypeId, int $status, UpdateStruct $contentType) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$contentTypeId
|
mixed
|
-
|
-
|
$status
|
int
|
-
|
One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
|
$contentType
|
UpdateStruct
|
-
|
-
|
This method updates the given $fieldDefinition on a Type.
|
public updateFieldDefinition(mixed $contentTypeId, int $status, FieldDefinition $fieldDefinition) : mixed
|
This method creates a new version of the Type with the updated
$fieldDefinition. It does not update existing content objects depending
on the
field (default) values.
Parameters
Name |
Type |
Default value |
Description |
$contentTypeId
|
mixed
|
-
|
-
|
$status
|
int
|
-
|
One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
|
$fieldDefinition
|
FieldDefinition
|
-
|
-
|
Tags
-
Throws
-
NotFoundException
Parameters