Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | List of all members
eZ\Publish\API\Repository\ContentTypeService Interface Reference
Inheritance diagram for eZ\Publish\API\Repository\ContentTypeService:

## Public Member Functions
| createContentTypeGroup (ContentTypeGroupCreateStruct $contentTypeGroupCreateStruct)
| Create a Content Type Group object. More...
| loadContentTypeGroup ($contentTypeGroupId, array $prioritizedLanguages=[])
| Get a Content Type Group object by id. More...
| loadContentTypeGroupByIdentifier ($contentTypeGroupIdentifier, array $prioritizedLanguages=[])
| Get a Content Type Group object by identifier. More...
| loadContentTypeGroups (array $prioritizedLanguages=[])
| Get all Content Type Groups. More...
| updateContentTypeGroup (ContentTypeGroup $contentTypeGroup, ContentTypeGroupUpdateStruct $contentTypeGroupUpdateStruct)
| Update a Content Type Group object. More...
| deleteContentTypeGroup (ContentTypeGroup $contentTypeGroup)
| Delete a Content Type Group. More...
| createContentType (ContentTypeCreateStruct $contentTypeCreateStruct, array $contentTypeGroups)
| Create a Content Type object. More...
| loadContentType ($contentTypeId, array $prioritizedLanguages=[])
| Get a Content Type object by id. More...
| loadContentTypeByIdentifier ($identifier, array $prioritizedLanguages=[])
| Get a Content Type object by identifier. More...
| loadContentTypeByRemoteId ($remoteId, array $prioritizedLanguages=[])
| Get a Content Type object by id. More...
| loadContentTypeDraft ($contentTypeId, bool $ignoreOwnership=false)
| Get a Content Type object draft by id. More...
| loadContentTypeList (array $contentTypeIds, array $prioritizedLanguages=[])
| Bulk-load Content Type objects by ids. More...
| loadContentTypes (ContentTypeGroup $contentTypeGroup, array $prioritizedLanguages=[])
| Get Content Type objects which belong to the given content type group. More...
| createContentTypeDraft (ContentType $contentType)
| Creates a draft from an existing content type. More...
| updateContentTypeDraft (ContentTypeDraft $contentTypeDraft, ContentTypeUpdateStruct $contentTypeUpdateStruct)
| Update a Content Type object. More...
| deleteContentType (ContentType $contentType)
| Delete a Content Type object. More...
| copyContentType (ContentType $contentType, User $creator=null)
| Copy Type incl fields and groupIds to a new Type object. More...
| assignContentTypeGroup (ContentType $contentType, ContentTypeGroup $contentTypeGroup)
| Assigns a content type to a content type group. More...
| unassignContentTypeGroup (ContentType $contentType, ContentTypeGroup $contentTypeGroup)
| Unassign a content type from a group. More...
| addFieldDefinition (ContentTypeDraft $contentTypeDraft, FieldDefinitionCreateStruct $fieldDefinitionCreateStruct)
| Adds a new field definition to an existing content type. More...
| removeFieldDefinition (ContentTypeDraft $contentTypeDraft, FieldDefinition $fieldDefinition)
| Remove a field definition from an existing Type. More...
| updateFieldDefinition (ContentTypeDraft $contentTypeDraft, FieldDefinition $fieldDefinition, FieldDefinitionUpdateStruct $fieldDefinitionUpdateStruct)
| Update a field definition. More...
| publishContentTypeDraft (ContentTypeDraft $contentTypeDraft)
| Publish the content type and update content objects. More...
| newContentTypeGroupCreateStruct ($identifier)
| Instantiates a new content type group create class. More...
| newContentTypeCreateStruct ($identifier)
| Instantiates a new content type create class. More...
| newContentTypeUpdateStruct ()
| Instantiates a new content type update struct. More...
| newContentTypeGroupUpdateStruct ()
| Instantiates a new content type update struct. More...
| newFieldDefinitionCreateStruct ($identifier, $fieldTypeIdentifier)
| Instantiates a field definition create struct. More...
| newFieldDefinitionUpdateStruct ()
| Instantiates a field definition update class. More...
| isContentTypeUsed (ContentType $contentType)
| Returns true if the given content type $contentType has content instances. More...
| removeContentTypeTranslation (ContentTypeDraft $contentTypeDraft, string $languageCode)
| deleteUserDrafts (int $userId)
| Delete all content type drafs created or modified by the user. More...

## Detailed Description

Definition at line 24 of file API/Repository/ContentTypeService.php.

## Member Function Documentation

## ◆ addFieldDefinition()

eZ\Publish\API\Repository\ContentTypeService::addFieldDefinition | ( | ContentTypeDraft | $contentTypeDraft,
|  | FieldDefinitionCreateStruct | $fieldDefinitionCreateStruct
| ) |  |

Adds a new field definition to an existing content type.

The content type must be in state DRAFT.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ assignContentTypeGroup()

eZ\Publish\API\Repository\ContentTypeService::assignContentTypeGroup | ( | ContentType | $contentType,
|  | ContentTypeGroup | $contentTypeGroup
| ) |  |

Assigns a content type to a content type group.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ copyContentType()

eZ\Publish\API\Repository\ContentTypeService::copyContentType | ( | ContentType | $contentType,
|  | User | $creator = `null`
| ) |  |

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.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ createContentType()

eZ\Publish\API\Repository\ContentTypeService::createContentType | ( | ContentTypeCreateStruct | $contentTypeCreateStruct,
|  | array | $contentTypeGroups
| ) |  |

Create a Content Type object.

The content type is created in the state STATUS_DRAFT.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ createContentTypeDraft()

eZ\Publish\API\Repository\ContentTypeService::createContentTypeDraft | ( | ContentType | $contentType | ) |

Creates a draft from an existing content type.

This is a complete copy of the content type which has the state STATUS_DRAFT.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ createContentTypeGroup()

eZ\Publish\API\Repository\ContentTypeService::createContentTypeGroup | ( | ContentTypeGroupCreateStruct | $contentTypeGroupCreateStruct | ) |

Create a Content Type Group object.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

## ◆ deleteContentType()

eZ\Publish\API\Repository\ContentTypeService::deleteContentType | ( | ContentType | $contentType | ) |

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.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ deleteContentTypeGroup()

eZ\Publish\API\Repository\ContentTypeService::deleteContentTypeGroup | ( | ContentTypeGroup | $contentTypeGroup | ) |

Delete a Content Type Group.

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

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ deleteUserDrafts()

eZ\Publish\API\Repository\ContentTypeService::deleteUserDrafts | ( | int | $userId | ) |

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

Parameters

  int | $userId |

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

## ◆ isContentTypeUsed()

eZ\Publish\API\Repository\ContentTypeService::isContentTypeUsed | ( | ContentType | $contentType | ) |

Returns true if the given content type $contentType has content instances.

Since
  6.0.1

Parameters

  \eZ\Publish\API\Repository\Values\ContentType\ContentType | $contentType |

Returns
  bool

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ loadContentType()

eZ\Publish\API\Repository\ContentTypeService::loadContentType | ( |  | $contentTypeId,
|  | array | $prioritizedLanguages = `[]`
| ) |  |

Get a Content Type object by id.

Exceptions

Implemented in eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

Referenced by eZ\Publish\Core\Repository\ContentTypeService\copyContentType().

## ◆ loadContentTypeByIdentifier()

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeByIdentifier | ( |  | $identifier,
|  | array | $prioritizedLanguages = `[]`
| ) |  |

Get a Content Type object by identifier.

Exceptions

Implemented in eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

Referenced by eZ\Publish\Core\Repository\ContentTypeService\updateContentTypeDraft().

## ◆ loadContentTypeByRemoteId()

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeByRemoteId | ( |  | $remoteId,
|  | array | $prioritizedLanguages = `[]`
| ) |  |

Get a Content Type object by id.

Exceptions

Implemented in eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

Referenced by eZ\Publish\Core\Repository\ContentTypeService\updateContentTypeDraft().

## ◆ loadContentTypeDraft()

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeDraft | ( |  | $contentTypeId,
|  | bool | $ignoreOwnership = `false`
| ) |  |

Get a Content Type object draft by id.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

Referenced by eZ\Publish\Core\Repository\ContentTypeService\publishContentTypeDraft(), eZ\Publish\Core\Repository\ContentTypeService\removeFieldDefinition(), eZ\Publish\Core\Repository\ContentTypeService\updateContentTypeDraft(), and eZ\Publish\Core\Repository\ContentTypeService\updateFieldDefinition().

## ◆ loadContentTypeGroup()

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeGroup | ( |  | $contentTypeGroupId,
|  | array | $prioritizedLanguages = `[]`
| ) |  |

Get a Content Type Group object by id.

Exceptions

Implemented in eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

Referenced by eZ\Publish\Core\Repository\ContentTypeService\deleteContentTypeGroup(), and eZ\Publish\Core\Repository\ContentTypeService\updateContentTypeGroup().

## ◆ loadContentTypeGroupByIdentifier()

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeGroupByIdentifier | ( |  | $contentTypeGroupIdentifier,
|  | array | $prioritizedLanguages = `[]`
| ) |  |

Get a Content Type Group object by identifier.

Exceptions

Implemented in eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

Referenced by eZ\Publish\Core\Repository\ContentTypeService\createContentTypeGroup(), and eZ\Publish\Core\Repository\ContentTypeService\updateContentTypeGroup().

## ◆ loadContentTypeGroups()

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeGroups | ( | array | $prioritizedLanguages = `[]` | ) |

Get all Content Type Groups.

Parameters

  string[] | $prioritizedLanguages | Used as prioritized language code on translated properties of returned object.

Returns
  \eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup[]

Implemented in eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

Referenced by eZ\Publish\Core\Repository\ContentTypeService\loadContentTypeGroupByIdentifier().

## ◆ loadContentTypeList()

eZ\Publish\API\Repository\ContentTypeService::loadContentTypeList | ( | array | $contentTypeIds,
|  | array | $prioritizedLanguages = `[]`
| ) |  |

Bulk-load Content Type objects by ids.

Note: it does not throw exceptions on load, just ignores erroneous items.

Since
  7.3

Parameters

  mixed[] | $contentTypeIds |
  string[] | $prioritizedLanguages | Used as prioritized language code on translated properties of returned object.

Returns
  \eZ\Publish\API\Repository\Values\ContentType\ContentType[]|iterable

Implemented in eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

## ◆ loadContentTypes()

eZ\Publish\API\Repository\ContentTypeService::loadContentTypes | ( | ContentTypeGroup | $contentTypeGroup,
|  | array | $prioritizedLanguages = `[]`
| ) |  |

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

Parameters

  \eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup | $contentTypeGroup |
  string[] | $prioritizedLanguages | Used as prioritized language code on translated properties of returned object.

Returns
  \eZ\Publish\API\Repository\Values\ContentType\ContentType[] an array of ContentType which have status DEFINED

Implemented in eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, eZ\Publish\Core\SignalSlot\ContentTypeService, and eZ\Publish\Core\REST\Client\ContentTypeService.

## ◆ newContentTypeCreateStruct()

eZ\Publish\API\Repository\ContentTypeService::newContentTypeCreateStruct | ( |  | $identifier | ) |

Instantiates a new content type create class.

Parameters

  string | $identifier |

Returns
  \eZ\Publish\API\Repository\Values\ContentType\ContentTypeCreateStruct

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

## ◆ newContentTypeGroupCreateStruct()

eZ\Publish\API\Repository\ContentTypeService::newContentTypeGroupCreateStruct | ( |  | $identifier | ) |

Instantiates a new content type group create class.

Parameters

  string | $identifier |

Returns
  \eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroupCreateStruct

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

## ◆ newContentTypeGroupUpdateStruct()

eZ\Publish\API\Repository\ContentTypeService::newContentTypeGroupUpdateStruct | ( |  | ) |

Instantiates a new content type update struct.

Returns
  \eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroupUpdateStruct

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

## ◆ newContentTypeUpdateStruct()

eZ\Publish\API\Repository\ContentTypeService::newContentTypeUpdateStruct | ( |  | ) |

Instantiates a new content type update struct.

Returns
  \eZ\Publish\API\Repository\Values\ContentType\ContentTypeUpdateStruct

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

## ◆ newFieldDefinitionCreateStruct()

eZ\Publish\API\Repository\ContentTypeService::newFieldDefinitionCreateStruct | ( |  | $identifier,
|  |  | $fieldTypeIdentifier
| ) |  |

Instantiates a field definition create struct.

Parameters

  string | $fieldTypeIdentifier | the required field type identifier
  string | $identifier | the required identifier for the field definition

Returns
  \eZ\Publish\API\Repository\Values\ContentType\FieldDefinitionCreateStruct

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

## ◆ newFieldDefinitionUpdateStruct()

eZ\Publish\API\Repository\ContentTypeService::newFieldDefinitionUpdateStruct | ( |  | ) |

Instantiates a field definition update class.

Returns
  \eZ\Publish\API\Repository\Values\ContentType\FieldDefinitionUpdateStruct

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService, and eZ\Publish\Core\Repository\ContentTypeService.

## ◆ publishContentTypeDraft()

eZ\Publish\API\Repository\ContentTypeService::publishContentTypeDraft | ( | ContentTypeDraft | $contentTypeDraft | ) |

Publish the content type and update content objects.

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

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ removeContentTypeTranslation()

eZ\Publish\API\Repository\ContentTypeService::removeContentTypeTranslation | ( | ContentTypeDraft | $contentTypeDraft,
|  | string | $languageCode
| ) |  |

Parameters

  \eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft | $contentTypeDraft |
  string | $languageCode |

Returns
  \eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ removeFieldDefinition()

eZ\Publish\API\Repository\ContentTypeService::removeFieldDefinition | ( | ContentTypeDraft | $contentTypeDraft,
|  | FieldDefinition | $fieldDefinition
| ) |  |

Remove a field definition from an existing Type.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ unassignContentTypeGroup()

eZ\Publish\API\Repository\ContentTypeService::unassignContentTypeGroup | ( | ContentType | $contentType,
|  | ContentTypeGroup | $contentTypeGroup
| ) |  |

Unassign a content type from a group.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ updateContentTypeDraft()

eZ\Publish\API\Repository\ContentTypeService::updateContentTypeDraft | ( | ContentTypeDraft | $contentTypeDraft,
|  | ContentTypeUpdateStruct | $contentTypeUpdateStruct
| ) |  |

Update a Content Type object.

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

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ updateContentTypeGroup()

eZ\Publish\API\Repository\ContentTypeService::updateContentTypeGroup | ( | ContentTypeGroup | $contentTypeGroup,
|  | ContentTypeGroupUpdateStruct | $contentTypeGroupUpdateStruct
| ) |  |

Update a Content Type Group object.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

## ◆ updateFieldDefinition()

eZ\Publish\API\Repository\ContentTypeService::updateFieldDefinition | ( | ContentTypeDraft | $contentTypeDraft,
|  | FieldDefinition | $fieldDefinition,
|  | FieldDefinitionUpdateStruct | $fieldDefinitionUpdateStruct
| ) |  |

Update a field definition.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\ContentTypeService, eZ\Publish\Core\REST\Client\ContentTypeService, and eZ\Publish\Core\Repository\SiteAccessAware\ContentTypeService.

The documentation for this interface was generated from the following file:

- API/Repository/ContentTypeService.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.