ContentTypeServiceDecorator
Properties¶
$innerService
¶
|
|
|
Methods¶
__construct()
¶
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $innerService | ContentTypeService | - | - |
addFieldDefinition()
¶
Adds a new field definition to an existing content type.
|
|
|
The content type must be in state DRAFT.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $contentTypeDraft | ContentTypeDraft | - | - |
| $fieldDefinitionCreateStruct | FieldDefinitionCreateStruct | - | - |
assignContentTypeGroup()
¶
Assigns a content type to a content type group.
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $contentType | ContentType | - | - |
| $contentTypeGroup | ContentTypeGroup | - | - |
copyContentType()
¶
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 | null |
If null the current-user is used instead |
Return values
createContentType()
¶
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, mixed> | - |
Required array of ContentTypeGroup to link type with (must contain one) |
Return values
createContentTypeDraft()
¶
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
createContentTypeGroup()
¶
Create a content type group object.
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $contentTypeGroupCreateStruct | ContentTypeGroupCreateStruct | - | - |
Return values
deleteContentType()
¶
Delete a content type object.
|
|
|
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 | - | - |
deleteContentTypeGroup()
¶
Delete a content type group.
|
|
|
This method only deletes an content type group which has content types without any content instances
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $contentTypeGroup | ContentTypeGroup | - | - |
deleteUserDrafts()
¶
Delete all content type drafs created or modified by the user.
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $userId | int | - | - |
findContentTypes()
¶
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $query | ContentTypeQuery|null | null | - |
| $prioritizedLanguages | array<string|int, mixed> | [] |
Used as prioritized language code on translated properties of returned object. |
Return values
isContentTypeUsed()
¶
Returns true if the given content type $contentType has content instances.
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $contentType | ContentType | - | - |
Return values
bool
loadContentType()
¶
Get a content type object by id.
|
|
|
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
loadContentTypeByIdentifier()
¶
Get a content type object by identifier.
|
|
|
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
loadContentTypeByRemoteId()
¶
Get a content type object by id.
|
|
|
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
loadContentTypeDraft()
¶
Get a content type object draft by id.
|
|
|
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
loadContentTypeGroup()
¶
Get a content type group object by id.
|
|
|
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
loadContentTypeGroupByIdentifier()
¶
Get a content type group object by identifier.
|
|
|
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
loadContentTypeGroups()
¶
Get all content type groups.
|
|
|
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>
loadContentTypeList()
¶
Bulk-load content type objects by ids.
|
|
|
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>
loadContentTypes()
¶
Get content type objects which belong to the given content type group.
|
|
|
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
newContentTypeCreateStruct()
¶
Instantiates a new content type create class.
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $identifier | string | - | - |
Return values
newContentTypeGroupCreateStruct()
¶
Instantiates a new content type group create class.
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $identifier | string | - | - |
Return values
newContentTypeGroupUpdateStruct()
¶
Instantiates a new content type update struct.
|
|
|
Return values
newContentTypeUpdateStruct()
¶
Instantiates a new content type update struct.
|
|
|
Return values
newFieldDefinitionCreateStruct()
¶
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
newFieldDefinitionUpdateStruct()
¶
Instantiates a field definition update class.
|
|
|
Return values
publishContentTypeDraft()
¶
Publish the content type and update content objects.
|
|
|
This method updates content objects, depending on the changed field definitions.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $contentTypeDraft | ContentTypeDraft | - | - |
removeContentTypeTranslation()
¶
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $contentTypeDraft | ContentTypeDraft | - | - |
| $languageCode | string | - | - |
Return values
removeFieldDefinition()
¶
Remove a field definition from an existing Type.
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $contentTypeDraft | ContentTypeDraft | - | - |
| $fieldDefinition | FieldDefinition | - | - |
unassignContentTypeGroup()
¶
Unassign a content type from a group.
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $contentType | ContentType | - | - |
| $contentTypeGroup | ContentTypeGroup | - | - |
updateContentTypeDraft()
¶
Update a content type object.
|
|
|
Does not update fields (fieldDefinitions), use ContentTypeService::updateFieldDefinition() to update them.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $contentTypeDraft | ContentTypeDraft | - | - |
| $contentTypeUpdateStruct | ContentTypeUpdateStruct | - | - |
updateContentTypeGroup()
¶
Update a content type group object.
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $contentTypeGroup | ContentTypeGroup | - |
the content type group to be updated |
| $contentTypeGroupUpdateStruct | ContentTypeGroupUpdateStruct | - | - |
updateFieldDefinition()
¶
Update a field definition.
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $contentTypeDraft | ContentTypeDraft | - |
the content type draft |
| $fieldDefinition | FieldDefinition | - |
the field definition which should be updated |
| $fieldDefinitionUpdateStruct | FieldDefinitionUpdateStruct | - | - |