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\SPI\Persistence\Content\Type\Handler Interface Reference
Inheritance diagram for eZ\Publish\SPI\Persistence\Content\Type\Handler:

## Public Member Functions
| createGroup (GroupCreateStruct $group)
| updateGroup (GroupUpdateStruct $group)
| deleteGroup ($groupId)
| loadGroup ($groupId)
| loadGroups (array $groupIds)
| Return list of unique Content Type Groups, with group id as key. More...
| loadGroupByIdentifier ($identifier)
| Loads Type Group by identifier. More...
| loadAllGroups ()
| loadContentTypes ($groupId, $status=Type::STATUS_DEFINED)
| loadContentTypeList (array $contentTypeIds)
| Return list of unique Content Types, with type id as key. More...
| load ($contentTypeId, $status=Type::STATUS_DEFINED)
| Loads a content type by id and status. More...
| loadByIdentifier ($identifier)
| Loads a (defined) content type by identifier. More...
| loadByRemoteId ($remoteId)
| Loads a (defined) content type by remote id. More...
| create (CreateStruct $contentType)
| update ($contentTypeId, $status, UpdateStruct $contentType)
| delete ($contentTypeId, $status)
| createDraft ($modifierId, $contentTypeId)
| Creates a draft of existing defined content type. More...
| copy ($userId, $contentTypeId, $status)
| Copy a Type incl fields and group-relations from a given status to a new Type with status Type::STATUS_DRAFT. More...
| unlink ($groupId, $contentTypeId, $status)
| Unlink a content type group from a content type. More...
| link ($groupId, $contentTypeId, $status)
| Link a content type group with a content type. More...
| getFieldDefinition ($id, $status)
| Returns field definition for the given field definition id. More...
| getContentCount ($contentTypeId)
| Counts the number of Content instances of the ContentType identified by given $contentTypeId. More...
| addFieldDefinition ($contentTypeId, $status, FieldDefinition $fieldDefinition)
| Adds a new field definition to an existing Type. More...
| removeFieldDefinition ($contentTypeId, $status, $fieldDefinitionId)
| Removes a field definition from an existing Type. More...
| updateFieldDefinition ($contentTypeId, $status, FieldDefinition $fieldDefinition)
| This method updates the given $fieldDefinition on a Type. More...
| publish ($contentTypeId)
| Update content objects. More...
| getSearchableFieldMap ()
| Returns content type, field definition and field type mapping information for search engine usage. More...
| removeContentTypeTranslation (int $contentTypeId, string $languageCode)
| deleteByUserAndStatus (int $userId, int $status)

## Detailed Description

Definition at line 13 of file SPI/Persistence/Content/Type/Handler.php.

## Member Function Documentation

## ◆ addFieldDefinition()

eZ\Publish\SPI\Persistence\Content\Type\Handler::addFieldDefinition | ( |  | $contentTypeId,
|  |  | $status,
|  | FieldDefinition | $fieldDefinition
| ) |  |

Adds a new field definition to an existing Type.

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

  mixed | $contentTypeId |
  int | $status | One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
  \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition | $fieldDefinition |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition

Exceptions

Implemented in eZ\Publish\Core\Persistence\Cache\ContentTypeHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler.

## ◆ copy()

eZ\Publish\SPI\Persistence\Content\Type\Handler::copy | ( |  | $userId,
|  |  | $contentTypeId,
|  |  | $status
| ) |  |

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

  mixed | $userId |
  mixed | $contentTypeId |
  int | $status | One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED

Exceptions

Implemented in eZ\Publish\Core\Persistence\Cache\ContentTypeHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler.

## ◆ create()

eZ\Publish\SPI\Persistence\Content\Type\Handler::create | ( | CreateStruct | $contentType | ) |

Parameters

  \eZ\Publish\SPI\Persistence\Content\Type\CreateStruct | $contentType |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type

## ◆ createDraft()

eZ\Publish\SPI\Persistence\Content\Type\Handler::createDraft | ( |  | $modifierId,
|  |  | $contentTypeId
| ) |  |

Creates a draft of existing defined content type.

Updates modified date, sets $modifierId and status to Type::STATUS_DRAFT on the new returned draft.

Parameters

  mixed | $modifierId |
  mixed | $contentTypeId |

Exceptions

Implemented in eZ\Publish\Core\Persistence\Cache\ContentTypeHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler.

## ◆ createGroup()

eZ\Publish\SPI\Persistence\Content\Type\Handler::createGroup | ( | GroupCreateStruct | $group | ) |

Parameters

  \eZ\Publish\SPI\Persistence\Content\Type\Group\CreateStruct | $group |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type\Group

Implemented in eZ\Publish\Core\Persistence\Cache\ContentTypeHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler.

## ◆ delete()

eZ\Publish\SPI\Persistence\Content\Type\Handler::delete | ( |  | $contentTypeId,
|  |  | $status
| ) |  |

Parameters

  mixed | $contentTypeId |
  int | $status | One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED

Exceptions

Implemented in eZ\Publish\Core\Persistence\Cache\ContentTypeHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler.

## ◆ deleteByUserAndStatus()

eZ\Publish\SPI\Persistence\Content\Type\Handler::deleteByUserAndStatus | ( | int | $userId,
|  | int | $status
| ) |  |

Parameters

  int | $userId |
  int | $status |

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ deleteGroup()

eZ\Publish\SPI\Persistence\Content\Type\Handler::deleteGroup | ( |  | $groupId | ) |

Parameters

  mixed | $groupId |

Exceptions

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ getContentCount()

eZ\Publish\SPI\Persistence\Content\Type\Handler::getContentCount | ( |  | $contentTypeId | ) |

Counts the number of Content instances of the ContentType identified by given $contentTypeId.

Parameters

  mixed | $contentTypeId |

Returns
  int

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ getFieldDefinition()

eZ\Publish\SPI\Persistence\Content\Type\Handler::getFieldDefinition | ( |  | $id,
|  |  | $status
| ) |  |

Returns field definition for the given field definition id.

Exceptions

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ getSearchableFieldMap()

eZ\Publish\SPI\Persistence\Content\Type\Handler::getSearchableFieldMap | ( |  | ) |

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.

Returns an array in the form:

`array( "<ContentType identifier>" => array( "<FieldDefinition identifier>" => array( "field_definition_id" => "<FieldDefinition id>", "field_type_identifier" => "<FieldType identifier>", ), ... ), ... )`

Returns
  array

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ link()

eZ\Publish\SPI\Persistence\Content\Type\Handler::link | ( |  | $groupId,
|  |  | $contentTypeId,
|  |  | $status
| ) |  |

Link a content type group with a content type.

Parameters

  mixed | $groupId |
  mixed | $contentTypeId |
  int | $status | One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED

Exceptions

Implemented in eZ\Publish\Core\Persistence\Cache\ContentTypeHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler.

## ◆ load()

eZ\Publish\SPI\Persistence\Content\Type\Handler::load | ( |  | $contentTypeId,
|  |  | $status = `Type::STATUS_DEFINED`
| ) |  |

Loads a content type by id and status.

Note: This method is responsible of having the Field Definitions of the loaded ContentType sorted by placement.

Parameters

  mixed | $contentTypeId |
  int | $status | One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED

Exceptions

Implemented in eZ\Publish\Core\Persistence\Cache\ContentTypeHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler.

## ◆ loadAllGroups()

eZ\Publish\SPI\Persistence\Content\Type\Handler::loadAllGroups | ( |  | ) |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type\Group[]

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ loadByIdentifier()

eZ\Publish\SPI\Persistence\Content\Type\Handler::loadByIdentifier | ( |  | $identifier | ) |

Loads a (defined) content type by identifier.

Note: This method is responsible of having the Field Definitions of the loaded ContentType sorted by placement.

Parameters

  string | $identifier |

Exceptions

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ loadByRemoteId()

eZ\Publish\SPI\Persistence\Content\Type\Handler::loadByRemoteId | ( |  | $remoteId | ) |

Loads a (defined) content type by remote id.

Note: This method is responsible of having the Field Definitions of the loaded ContentType sorted by placement.

Parameters

  mixed | $remoteId |

Exceptions

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ loadContentTypeList()

eZ\Publish\SPI\Persistence\Content\Type\Handler::loadContentTypeList | ( | array | $contentTypeIds | ) |

Return list of unique Content Types, with type id as key.

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

  array | $contentTypeIds |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type[]

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ loadContentTypes()

eZ\Publish\SPI\Persistence\Content\Type\Handler::loadContentTypes | ( |  | $groupId,
|  |  | $status = `Type::STATUS_DEFINED`
| ) |  |

Parameters

  mixed | $groupId |
  int | $status | One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED

Returns
  \eZ\Publish\SPI\Persistence\Content\Type[]

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Cache\ContentTypeHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler.

## ◆ loadGroup()

eZ\Publish\SPI\Persistence\Content\Type\Handler::loadGroup | ( |  | $groupId | ) |

Parameters

  mixed | $groupId |

Exceptions

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ loadGroupByIdentifier()

eZ\Publish\SPI\Persistence\Content\Type\Handler::loadGroupByIdentifier | ( |  | $identifier | ) |

Loads Type Group by identifier.

Legacy note: Uses name for identifier.

Parameters

  string | $identifier |

Exceptions

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ loadGroups()

eZ\Publish\SPI\Persistence\Content\Type\Handler::loadGroups | ( | array | $groupIds | ) |

Return list of unique Content Type Groups, with group id as key.

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

  array | $groupIds |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type\Group[]

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ publish()

eZ\Publish\SPI\Persistence\Content\Type\Handler::publish | ( |  | $contentTypeId | ) |

Update content objects.

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

  mixed | $contentTypeId |

Exceptions

Implemented in eZ\Publish\Core\Persistence\Cache\ContentTypeHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler.

## ◆ removeContentTypeTranslation()

eZ\Publish\SPI\Persistence\Content\Type\Handler::removeContentTypeTranslation | ( | int | $contentTypeId,
|  | string | $languageCode
| ) |  |

Parameters

  int | $contentTypeId |
  string | $languageCode |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ removeFieldDefinition()

eZ\Publish\SPI\Persistence\Content\Type\Handler::removeFieldDefinition | ( |  | $contentTypeId,
|  |  | $status,
|  |  | $fieldDefinitionId
| ) |  |

Removes a field definition from an existing Type.

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

  mixed | $contentTypeId |
  int | $status | One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
  mixed | $fieldDefinitionId |

Exceptions

Implemented in eZ\Publish\Core\Persistence\Cache\ContentTypeHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler.

## ◆ unlink()

eZ\Publish\SPI\Persistence\Content\Type\Handler::unlink | ( |  | $groupId,
|  |  | $contentTypeId,
|  |  | $status
| ) |  |

Unlink a content type group from a content type.

Parameters

  mixed | $groupId |
  mixed | $contentTypeId |
  int | $status | One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED

Exceptions

Implemented in eZ\Publish\Core\Persistence\Cache\ContentTypeHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler.

## ◆ update()

eZ\Publish\SPI\Persistence\Content\Type\Handler::update | ( |  | $contentTypeId,
|  |  | $status,
|  | UpdateStruct | $contentType
| ) |  |

Parameters

  mixed | $contentTypeId |
  int | $status | One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
  \eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct | $contentType |

Implemented in eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

## ◆ updateFieldDefinition()

eZ\Publish\SPI\Persistence\Content\Type\Handler::updateFieldDefinition | ( |  | $contentTypeId,
|  |  | $status,
|  | FieldDefinition | $fieldDefinition
| ) |  |

This method updates the given $fieldDefinition on a Type.

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

  mixed | $contentTypeId |
  int | $status | One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
  \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition | $fieldDefinition |

Exceptions

Implemented in eZ\Publish\Core\Persistence\Cache\ContentTypeHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler.

## ◆ updateGroup()

eZ\Publish\SPI\Persistence\Content\Type\Handler::updateGroup | ( | GroupUpdateStruct | $group | ) |

Parameters

  \eZ\Publish\SPI\Persistence\Content\Type\Group\UpdateStruct | $group |

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler, eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler, and eZ\Publish\Core\Persistence\Cache\ContentTypeHandler.

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

- SPI/Persistence/Content/Type/Handler.php

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