Copied!

ContentTypeServiceDecorator

ContentTypeServiceDecorator.php : 24
Implements ContentTypeService

Properties

protected $innerService

ContentTypeServiceDecorator.php : 27
protected ContentTypeService $innerService

Methods

public__construct()

ContentTypeServiceDecorator.php : 29
public __construct(ContentTypeService $innerService)

Parameters

Name Type Default value Description
$innerService ContentTypeService - -

publicaddFieldDefinition()

ContentTypeServiceDecorator.php : 155

Adds a new field definition to an existing content type.

public addFieldDefinition(ContentTypeDraft $contentTypeDraft, FieldDefinitionCreateStruct $fieldDefinitionCreateStruct) : void

The content type must be in state DRAFT.

Parameters

Name Type Default value Description
$contentTypeDraft ContentTypeDraft - -
$fieldDefinitionCreateStruct FieldDefinitionCreateStruct - -

publicassignContentTypeGroup()

ContentTypeServiceDecorator.php : 141

Assigns a content type to a content type group.

public assignContentTypeGroup(ContentType $contentType, ContentTypeGroup $contentTypeGroup) : void

Parameters

Name Type Default value Description
$contentType ContentType - -
$contentTypeGroup ContentTypeGroup - -

publiccopyContentType()

ContentTypeServiceDecorator.php : 134

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

public copyContentType(ContentType $contentType[, User $creator = null ]) : ContentType

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

publiccreateContentType()

ContentTypeServiceDecorator.php : 70

Create a content type object.

public createContentType(ContentTypeCreateStruct $contentTypeCreateStruct, array<string|int, mixed> $contentTypeGroups) : ContentTypeDraft

The content type is created in the state STATUS_DRAFT.

Parameters

Name Type Default value Description
$contentTypeCreateStruct ContentTypeCreateStruct - -
$contentTypeGroups array<string|int, mixed> -

Required array of ContentTypeGroup to link type with (must contain one)

Return values

ContentTypeDraft

publiccreateContentTypeDraft()

ContentTypeServiceDecorator.php : 117

Creates a draft from an existing content type.

public createContentTypeDraft(ContentType $contentType) : ContentTypeDraft

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

publiccreateContentTypeGroup()

ContentTypeServiceDecorator.php : 34

Create a content type group object.

public createContentTypeGroup(ContentTypeGroupCreateStruct $contentTypeGroupCreateStruct) : ContentTypeGroup

Parameters

Name Type Default value Description
$contentTypeGroupCreateStruct ContentTypeGroupCreateStruct - -

Return values

ContentTypeGroup

publicdeleteContentType()

ContentTypeServiceDecorator.php : 129

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 - -

publicdeleteContentTypeGroup()

ContentTypeServiceDecorator.php : 65

Delete a content type group.

public deleteContentTypeGroup(ContentTypeGroup $contentTypeGroup) : void

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

Parameters

Name Type Default value Description
$contentTypeGroup ContentTypeGroup - -

publicdeleteUserDrafts()

ContentTypeServiceDecorator.php : 226

Delete all content type drafs created or modified by the user.

public deleteUserDrafts(int $userId) : void

Parameters

Name Type Default value Description
$userId int - -

publicisContentTypeUsed()

ContentTypeServiceDecorator.php : 214

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

publicloadContentType()

ContentTypeServiceDecorator.php : 77

Get a content type object by id.

public loadContentType(int $contentTypeId[, array<string|int, mixed> $prioritizedLanguages = [] ]) : ContentType

Parameters

Name Type Default value Description
$contentTypeId int - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

ContentType

publicloadContentTypeByIdentifier()

ContentTypeServiceDecorator.php : 84

Get a content type object by identifier.

public loadContentTypeByIdentifier(string $identifier[, array<string|int, mixed> $prioritizedLanguages = [] ]) : ContentType

Parameters

Name Type Default value Description
$identifier string - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

ContentType

publicloadContentTypeByRemoteId()

ContentTypeServiceDecorator.php : 91

Get a content type object by id.

public loadContentTypeByRemoteId(string $remoteId[, array<string|int, mixed> $prioritizedLanguages = [] ]) : ContentType

Parameters

Name Type Default value Description
$remoteId string - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

ContentType

publicloadContentTypeDraft()

ContentTypeServiceDecorator.php : 98

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

publicloadContentTypeGroup()

ContentTypeServiceDecorator.php : 39

Get a content type group object by id.

public loadContentTypeGroup(int $contentTypeGroupId[, array<string|int, mixed> $prioritizedLanguages = [] ]) : ContentTypeGroup

Parameters

Name Type Default value Description
$contentTypeGroupId int - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

ContentTypeGroup

publicloadContentTypeGroupByIdentifier()

ContentTypeServiceDecorator.php : 46

Get a content type group object by identifier.

public loadContentTypeGroupByIdentifier(string $contentTypeGroupIdentifier[, array<string|int, mixed> $prioritizedLanguages = [] ]) : ContentTypeGroup

Parameters

Name Type Default value Description
$contentTypeGroupIdentifier string - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

ContentTypeGroup

publicloadContentTypeGroups()

ContentTypeServiceDecorator.php : 53

Get all content type groups.

public loadContentTypeGroups([array<string|int, mixed> $prioritizedLanguages = [] ]) : array<string|int, ContentTypeGroup>

Parameters

Name Type Default value Description
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

array<string|int, ContentTypeGroup>

publicloadContentTypeList()

ContentTypeServiceDecorator.php : 103

Bulk-load content type objects by ids.

public loadContentTypeList(array<string|int, mixed> $contentTypeIds[, array<string|int, mixed> $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, mixed> - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

array<string|int, ContentType>|iterable<string|int, mixed>

publicloadContentTypes()

ContentTypeServiceDecorator.php : 110

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

public loadContentTypes(ContentTypeGroup $contentTypeGroup[, array<string|int, mixed> $prioritizedLanguages = [] ]) : array<string|int, ContentType>

Parameters

Name Type Default value Description
$contentTypeGroup ContentTypeGroup - -
$prioritizedLanguages array<string|int, mixed> []

Used as prioritized language code on translated properties of returned object.

Return values

array<string|int, ContentType>

an array of ContentType which have status DEFINED

publicnewContentTypeCreateStruct()

ContentTypeServiceDecorator.php : 187

Instantiates a new content type create class.

public newContentTypeCreateStruct(string $identifier) : ContentTypeCreateStruct

Parameters

Name Type Default value Description
$identifier string - -

Return values

ContentTypeCreateStruct

publicnewContentTypeGroupCreateStruct()

ContentTypeServiceDecorator.php : 182

Instantiates a new content type group create class.

public newContentTypeGroupCreateStruct(string $identifier) : ContentTypeGroupCreateStruct

Parameters

Name Type Default value Description
$identifier string - -

Return values

ContentTypeGroupCreateStruct

publicnewContentTypeGroupUpdateStruct()

ContentTypeServiceDecorator.php : 197

Instantiates a new content type update struct.

public newContentTypeGroupUpdateStruct() : ContentTypeGroupUpdateStruct

Return values

ContentTypeGroupUpdateStruct

publicnewContentTypeUpdateStruct()

ContentTypeServiceDecorator.php : 192

Instantiates a new content type update struct.

public newContentTypeUpdateStruct() : ContentTypeUpdateStruct

Return values

ContentTypeUpdateStruct

publicnewFieldDefinitionCreateStruct()

ContentTypeServiceDecorator.php : 202

Instantiates a field definition create struct.

public newFieldDefinitionCreateStruct(string $identifier, string $fieldTypeIdentifier) : FieldDefinitionCreateStruct

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

publicnewFieldDefinitionUpdateStruct()

ContentTypeServiceDecorator.php : 209

Instantiates a field definition update class.

public newFieldDefinitionUpdateStruct() : FieldDefinitionUpdateStruct

Return values

FieldDefinitionUpdateStruct

publicpublishContentTypeDraft()

ContentTypeServiceDecorator.php : 177

Publish the content type and update content objects.

public publishContentTypeDraft(ContentTypeDraft $contentTypeDraft) : void

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

Parameters

Name Type Default value Description
$contentTypeDraft ContentTypeDraft - -

publicremoveContentTypeTranslation()

ContentTypeServiceDecorator.php : 219
public removeContentTypeTranslation(ContentTypeDraft $contentTypeDraft, string $languageCode) : ContentTypeDraft

Parameters

Name Type Default value Description
$contentTypeDraft ContentTypeDraft - -
$languageCode string - -

Return values

ContentTypeDraft

publicremoveFieldDefinition()

ContentTypeServiceDecorator.php : 162

Remove a field definition from an existing Type.

public removeFieldDefinition(ContentTypeDraft $contentTypeDraft, FieldDefinition $fieldDefinition) : void

Parameters

Name Type Default value Description
$contentTypeDraft ContentTypeDraft - -
$fieldDefinition FieldDefinition - -

publicunassignContentTypeGroup()

ContentTypeServiceDecorator.php : 148

Unassign a content type from a group.

public unassignContentTypeGroup(ContentType $contentType, ContentTypeGroup $contentTypeGroup) : void

Parameters

Name Type Default value Description
$contentType ContentType - -
$contentTypeGroup ContentTypeGroup - -

publicupdateContentTypeDraft()

ContentTypeServiceDecorator.php : 122

Update a content type object.

public updateContentTypeDraft(ContentTypeDraft $contentTypeDraft, ContentTypeUpdateStruct $contentTypeUpdateStruct) : void

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

Parameters

Name Type Default value Description
$contentTypeDraft ContentTypeDraft - -
$contentTypeUpdateStruct ContentTypeUpdateStruct - -

publicupdateContentTypeGroup()

ContentTypeServiceDecorator.php : 58

Update a content type group object.

public updateContentTypeGroup(ContentTypeGroup $contentTypeGroup, ContentTypeGroupUpdateStruct $contentTypeGroupUpdateStruct) : void

Parameters

Name Type Default value Description
$contentTypeGroup ContentTypeGroup -

the content type group to be updated

$contentTypeGroupUpdateStruct ContentTypeGroupUpdateStruct - -

publicupdateFieldDefinition()

ContentTypeServiceDecorator.php : 169

Update a field definition.

public updateFieldDefinition(ContentTypeDraft $contentTypeDraft, FieldDefinition $fieldDefinition, FieldDefinitionUpdateStruct $fieldDefinitionUpdateStruct) : void

Parameters

Name Type Default value Description
$contentTypeDraft ContentTypeDraft -

the content type draft

$fieldDefinition FieldDefinition -

the field definition which should be updated

$fieldDefinitionUpdateStruct FieldDefinitionUpdateStruct - -