Copied!

Handler

Handler.php : 13

Methods

publicaddFieldDefinition()

Handler.php : 256

Adds a new field definition to an existing Type.

public addFieldDefinition(mixed $contentTypeId, int $status, FieldDefinition $fieldDefinition) : FieldDefinition

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

If type is not found

publiccopy()

Handler.php : 191

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

publiccreate()

Handler.php : 144
public create(CreateStruct $contentType) : Type

Parameters

Name Type Default value Description
$contentType CreateStruct - -

Return values

Type

publiccreateDraft()

Handler.php : 173

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

publiccreateGroup()

Handler.php : 20
public createGroup(CreateStruct $group) : Group

Parameters

Name Type Default value Description
$group CreateStruct - -

Return values

Group

publicdelete()

Handler.php : 159
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

publicdeleteByUserAndStatus()

Handler.php : 347
public deleteByUserAndStatus(int $userId, int $status) : void

Parameters

Name Type Default value Description
$userId int - -
$status int - -

publicdeleteGroup()

Handler.php : 33
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

publicgetContentCount()

Handler.php : 237

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

publicgetFieldDefinition()

Handler.php : 228

Returns field definition for the given field definition id.

public getFieldDefinition(mixed $id, int $status) : FieldDefinition

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

publicgetSearchableFieldMap()

Handler.php : 333

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>

Handler.php : 216

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

publicload()

Handler.php : 111

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

publicloadAllGroups()

Handler.php : 72
public loadAllGroups() : array<string|int, Group>

Return values

array<string|int, Group>

publicloadByIdentifier()

Handler.php : 124

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

publicloadByRemoteId()

Handler.php : 137

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

publicloadContentTypeList()

Handler.php : 92

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>

publicloadContentTypes()

Handler.php : 80
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>

publicloadContentTypesByFieldDefinitionIdentifier()

Handler.php : 97
public loadContentTypesByFieldDefinitionIdentifier(string $identifier) : array<string|int, Type>

Parameters

Name Type Default value Description
$identifier string - -

Return values

array<string|int, Type>

publicloadGroup()

Handler.php : 42
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

publicloadGroupByIdentifier()

Handler.php : 67

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

publicloadGroups()

Handler.php : 54

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>

publicpublish()

Handler.php : 309

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

publicremoveContentTypeTranslation()

Handler.php : 341
public removeContentTypeTranslation(int $contentTypeId, string $languageCode) : Type

Parameters

Name Type Default value Description
$contentTypeId int - -
$languageCode string - -

Return values

Type

publicremoveFieldDefinition()

Handler.php : 271

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

If field is not found

Handler.php : 204

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

publicupdate()

Handler.php : 151
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 - -

publicupdateFieldDefinition()

Handler.php : 293

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

If field is not found

publicupdateGroup()

Handler.php : 25
public updateGroup(UpdateStruct $group) : mixed

Parameters

Name Type Default value Description
$group UpdateStruct - -