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

Public Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\SignalSlot\ContentTypeService Class Reference

ContentTypeService class. More...

Inheritance diagram for eZ\Publish\Core\SignalSlot\ContentTypeService:

## Public Member Functions
| __construct (ContentTypeServiceInterface $service, SignalDispatcher $signalDispatcher)
| Constructor. More...
| createContentTypeGroup (ContentTypeGroupCreateStruct $contentTypeGroupCreateStruct)
| Create a Content Type Group object. More...
| loadContentTypeGroup ($contentTypeGroupId, array $prioritizedLanguages=[])
  | {Get a Content Type Group object by id. Exceptions
} More...
| loadContentTypeGroupByIdentifier ($contentTypeGroupIdentifier, array $prioritizedLanguages=[])
  | {Get a Content Type Group object by identifier. Exceptions
} More...
| 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[] } 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. Exceptions
} More...
| loadContentTypeByIdentifier ($identifier, array $prioritizedLanguages=[])
  | {Get a Content Type object by identifier. Exceptions
} More...
| loadContentTypeByRemoteId ($remoteId, array $prioritizedLanguages=[])
  | {Get a Content Type object by id. Exceptions
} 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.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 } More...
| 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 } 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 $user=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...

## Protected Attributes
| $service
| $signalDispatcher

## Detailed Description

ContentTypeService class.

Definition at line 40 of file Core/SignalSlot/ContentTypeService.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\SignalSlot\ContentTypeService::__construct | ( | ContentTypeServiceInterface | $service,
|  | SignalDispatcher | $signalDispatcher
| ) |  |

Constructor.

Construct service object from aggregated service and signal dispatcher

Parameters

  \eZ\Publish\API\Repository\ContentTypeService | $service |
  \eZ\Publish\Core\SignalSlot\SignalDispatcher | $signalDispatcher |

Definition at line 65 of file Core/SignalSlot/ContentTypeService.php.

References eZ\Publish\Core\SignalSlot\ContentTypeService\$service, and eZ\Publish\Core\SignalSlot\ContentTypeService\$signalDispatcher.

## Member Function Documentation

## ◆ addFieldDefinition()

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 424 of file Core/SignalSlot/ContentTypeService.php.

## ◆ assignContentTypeGroup()

eZ\Publish\Core\SignalSlot\ContentTypeService::assignContentTypeGroup | ( | ContentType | $contentType,
|  | ContentTypeGroup | $contentTypeGroup
| ) |  |

Assigns a content type to a content type group.

Exceptions

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 367 of file Core/SignalSlot/ContentTypeService.php.

## ◆ copyContentType()

eZ\Publish\Core\SignalSlot\ContentTypeService::copyContentType | ( | ContentType | $contentType,
|  | User | $user = `null`
| ) |  |

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

New Type will have $userId as creator / modifier, created / modified should be updated with current time, updated remoteId and identifier should be appended with '_' + unique string.

Exceptions

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 343 of file Core/SignalSlot/ContentTypeService.php.

## ◆ createContentType()

eZ\Publish\Core\SignalSlot\ContentTypeService::createContentType | ( | ContentTypeCreateStruct | $contentTypeCreateStruct,
|  | array | $contentTypeGroups
| ) |  |

Create a Content Type object.

The content type is created in the state STATUS_DRAFT.

Exceptions

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 185 of file Core/SignalSlot/ContentTypeService.php.

## ◆ createContentTypeDraft()

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 267 of file Core/SignalSlot/ContentTypeService.php.

## ◆ createContentTypeGroup()

eZ\Publish\Core\SignalSlot\ContentTypeService::createContentTypeGroup | ( | ContentTypeGroupCreateStruct | $contentTypeGroupCreateStruct | ) |

Create a Content Type Group object.

Exceptions

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 81 of file Core/SignalSlot/ContentTypeService.php.

## ◆ deleteContentType()

eZ\Publish\Core\SignalSlot\ContentTypeService::deleteContentType | ( | ContentType | $contentType | ) |

Delete a Content Type object.

Deletes a content type if it has no instances

Exceptions

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 316 of file Core/SignalSlot/ContentTypeService.php.

## ◆ deleteContentTypeGroup()

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 152 of file Core/SignalSlot/ContentTypeService.php.

## ◆ deleteUserDrafts()

eZ\Publish\Core\SignalSlot\ContentTypeService::deleteUserDrafts | ( | int | $userId | ) |

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

Parameters

  int | $userId |

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 615 of file Core/SignalSlot/ContentTypeService.php.

## ◆ isContentTypeUsed()

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 589 of file Core/SignalSlot/ContentTypeService.php.

## ◆ loadContentType()

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

{Get a Content Type object by id.

Exceptions

}

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 202 of file Core/SignalSlot/ContentTypeService.php.

## ◆ loadContentTypeByIdentifier()

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

{Get a Content Type object by identifier.

Exceptions

}

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 210 of file Core/SignalSlot/ContentTypeService.php.

## ◆ loadContentTypeByRemoteId()

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

{Get a Content Type object by id.

Exceptions

}

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 218 of file Core/SignalSlot/ContentTypeService.php.

## ◆ loadContentTypeDraft()

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

Get a Content Type object draft by id.

Exceptions

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 233 of file Core/SignalSlot/ContentTypeService.php.

## ◆ loadContentTypeGroup()

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

{Get a Content Type Group object by id.

Exceptions

}

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 98 of file Core/SignalSlot/ContentTypeService.php.

## ◆ loadContentTypeGroupByIdentifier()

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

{Get a Content Type Group object by identifier.

Exceptions

}

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 106 of file Core/SignalSlot/ContentTypeService.php.

## ◆ loadContentTypeGroups()

eZ\Publish\Core\SignalSlot\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[]

}

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 114 of file Core/SignalSlot/ContentTypeService.php.

## ◆ loadContentTypeList()

eZ\Publish\Core\SignalSlot\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

}

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 241 of file Core/SignalSlot/ContentTypeService.php.

## ◆ loadContentTypes()

eZ\Publish\Core\SignalSlot\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

}

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 249 of file Core/SignalSlot/ContentTypeService.php.

## ◆ newContentTypeCreateStruct()

eZ\Publish\Core\SignalSlot\ContentTypeService::newContentTypeCreateStruct | ( |  | $identifier | ) |

Instantiates a new content type create class.

Parameters

  string | $identifier |

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

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 532 of file Core/SignalSlot/ContentTypeService.php.

## ◆ newContentTypeGroupCreateStruct()

eZ\Publish\Core\SignalSlot\ContentTypeService::newContentTypeGroupCreateStruct | ( |  | $identifier | ) |

Instantiates a new content type group create class.

Parameters

  string | $identifier |

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

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 520 of file Core/SignalSlot/ContentTypeService.php.

## ◆ newContentTypeGroupUpdateStruct()

eZ\Publish\Core\SignalSlot\ContentTypeService::newContentTypeGroupUpdateStruct | ( |  | ) |

Instantiates a new content type update struct.

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

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 552 of file Core/SignalSlot/ContentTypeService.php.

## ◆ newContentTypeUpdateStruct()

eZ\Publish\Core\SignalSlot\ContentTypeService::newContentTypeUpdateStruct | ( |  | ) |

Instantiates a new content type update struct.

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

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 542 of file Core/SignalSlot/ContentTypeService.php.

## ◆ newFieldDefinitionCreateStruct()

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 565 of file Core/SignalSlot/ContentTypeService.php.

## ◆ newFieldDefinitionUpdateStruct()

eZ\Publish\Core\SignalSlot\ContentTypeService::newFieldDefinitionUpdateStruct | ( |  | ) |

Instantiates a field definition update class.

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

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 575 of file Core/SignalSlot/ContentTypeService.php.

## ◆ publishContentTypeDraft()

eZ\Publish\Core\SignalSlot\ContentTypeService::publishContentTypeDraft | ( | ContentTypeDraft | $contentTypeDraft | ) |

Publish the content type and update content objects.

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

Exceptions

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 499 of file Core/SignalSlot/ContentTypeService.php.

## ◆ removeContentTypeTranslation()

eZ\Publish\Core\SignalSlot\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

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 600 of file Core/SignalSlot/ContentTypeService.php.

## ◆ removeFieldDefinition()

eZ\Publish\Core\SignalSlot\ContentTypeService::removeFieldDefinition | ( | ContentTypeDraft | $contentTypeDraft,
|  | FieldDefinition | $fieldDefinition
| ) |  |

Remove a field definition from an existing Type.

Exceptions

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 447 of file Core/SignalSlot/ContentTypeService.php.

## ◆ unassignContentTypeGroup()

eZ\Publish\Core\SignalSlot\ContentTypeService::unassignContentTypeGroup | ( | ContentType | $contentType,
|  | ContentTypeGroup | $contentTypeGroup
| ) |  |

Unassign a content type from a group.

Exceptions

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 392 of file Core/SignalSlot/ContentTypeService.php.

## ◆ updateContentTypeDraft()

eZ\Publish\Core\SignalSlot\ContentTypeService::updateContentTypeDraft | ( | ContentTypeDraft | $contentTypeDraft,
|  | ContentTypeUpdateStruct | $contentTypeUpdateStruct
| ) |  |

Update a Content Type object.

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

Exceptions

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 292 of file Core/SignalSlot/ContentTypeService.php.

## ◆ updateContentTypeGroup()

eZ\Publish\Core\SignalSlot\ContentTypeService::updateContentTypeGroup | ( | ContentTypeGroup | $contentTypeGroup,
|  | ContentTypeGroupUpdateStruct | $contentTypeGroupUpdateStruct
| ) |  |

Update a Content Type Group object.

Exceptions

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 128 of file Core/SignalSlot/ContentTypeService.php.

## ◆ updateFieldDefinition()

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

Update a field definition.

Exceptions

Implements eZ\Publish\API\Repository\ContentTypeService.

Definition at line 473 of file Core/SignalSlot/ContentTypeService.php.

## Member Data Documentation

## ◆ $service

eZ\Publish\Core\SignalSlot\ContentTypeService::$service
| protected

Definition at line 47 of file Core/SignalSlot/ContentTypeService.php.

Referenced by eZ\Publish\Core\SignalSlot\ContentTypeService\__construct().

## ◆ $signalDispatcher

eZ\Publish\Core\SignalSlot\ContentTypeService::$signalDispatcher
| protected

Definition at line 54 of file Core/SignalSlot/ContentTypeService.php.

Referenced by eZ\Publish\Core\SignalSlot\ContentTypeService\__construct().

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

- Core/SignalSlot/ContentTypeService.php

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