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

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
eZ\Publish\Core\Persistence\Legacy\Content\Handler Class Reference

The Content Handler stores Content and ContentType objects. More...

Inheritance diagram for eZ\Publish\Core\Persistence\Legacy\Content\Handler:

## Public Member Functions
| __construct (Gateway $contentGateway, LocationGateway $locationGateway, Mapper $mapper, FieldHandler $fieldHandler, SlugConverter $slugConverter, UrlAliasGateway $urlAliasGateway, ContentTypeHandler $contentTypeHandler, TreeHandler $treeHandler, LoggerInterface $logger=null)
| Creates a new content handler. More...
| create (CreateStruct $struct)
| Creates a new Content entity in the storage engine. More...
| publish ($contentId, $versionNo, MetadataUpdateStruct $metaDataUpdateStruct)
| Performs the publishing operations required to set the version identified by $updateStruct->versionNo and $updateStruct->id as the published one. More...
| createDraftFromVersion ($contentId, $srcVersion, $userId, ?string $languageCode=null)
| Creates a new draft version from $contentId in $version. More...
| load ($id, $version=null, array $translations=null)
  | {Returns the raw data of a content object identified by $id, in a struct.If you want to load current version, $version number can be omitted to make sure you don't need to rely on search index (async) or having to load in two steps (first content info then content, risking changes in between to current version).Optionally a translation filter may be specified. If specified only the translations with the listed language codes will be retrieved. If not, all translations will be retrieved. Parameters
  int | string | $id |
  int | null | $version |
  string[] | null | $translations |
Returns \eZ\Publish\SPI\Persistence\Content Content value object } More...
| loadContentList (array $contentIds, array $translations=null)
  | {Return list of unique Content, with content 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.If items are missing but for other reasons then not being found, for instance exceptions during loading field data. Then the exception will be logged as warning or error depending on severity. The most common case of possible exceptions during loading of Content data is migration, where either custom Field Type configuration or implementation might not be aligned with new version of the system.NOTE!!: If you want to take always available flag into account, append main language to the list of languages(unless caller is asking for all languages). In some edge cases you'll end up with a bit more data returned, but upside is that storage engine is able to handle far larger datasets. Parameters
  int[] | $contentIds |
  string[] | null | $translations |
Returns \eZ\Publish\SPI\Persistence\Content[] } More...
| loadContentInfo ($contentId)
| Returns the metadata object for a content identified by $contentId. More...
| loadContentInfoList (array $contentIds)
| Return list of unique Content Info, with content id as key. More...
| loadContentInfoByRemoteId ($remoteId)
| Returns the metadata object for a content identified by $remoteId. More...
| loadVersionInfo ($contentId, $versionNo=null)
  | {Returns the version object for a content/version identified by $contentId and $versionNo. Exceptions
} More...
| countDraftsForUser (int $userId)
| Returns the number of versions with draft status created by the given $userId. More...
| loadDraftsForUser ($userId)
| Returns all versions with draft status created by the given $userId. More...
| loadDraftListForUser (int $userId, int $offset=0, int $limit=-1)
  | {Loads drafts for a user when content is not in the trash.The list is sorted by modification date. Parameters
  int | $userId |
  int | $offset |
  int | $limit |
Returns \eZ\Publish\SPI\Persistence\Content\VersionInfo[] } More...
| setStatus ($contentId, $status, $version)
| Sets the status of object identified by $contentId and $version to $status. More...
| updateMetadata ($contentId, MetadataUpdateStruct $content)
| Updates a content object meta data, identified by $contentId. More...
| updateContent ($contentId, $versionNo, UpdateStruct $updateStruct)
| Updates a content version, identified by $contentId and $versionNo. More...
| deleteContent ($contentId)
| Deletes all versions and fields, all locations (subtree), and all relations. More...
| removeRawContent ($contentId)
| Deletes raw content data. More...
| deleteVersion ($contentId, $versionNo)
| Deletes given version, its fields, node assignment, relations and names. More...
| listVersions ($contentId, $status=null, $limit=-1)
| Returns the versions for $contentId. More...
| copy ($contentId, $versionNo=null, $newOwnerId=null)
| Copy Content with Fields, Versions & Relations from $contentId in $version. More...
| addRelation (RelationCreateStruct $createStruct)
| Creates a relation between $sourceContentId in $sourceContentVersionNo and $destinationContentId with a specific $type. More...
| removeRelation ($relationId, $type)
| Removes a relation by relation Id. More...
| loadRelations ($sourceContentId, $sourceContentVersionNo=null, $type=null)
| Loads relations from $sourceContentId. More...
| countReverseRelations (int $destinationContentId, ?int $type=null)
  | {Counts relations from $destinationContentId only against published versions.Optionally, count only those with $type. Parameters
  int | $destinationContentId | Destination Content ID
  int | null | $type | The relation type bitmask {
See also \eZ\Publish\API\Repository\Values\Content\Relation} Returns int } More...
| loadReverseRelations ($destinationContentId, $type=null)
| Loads relations from $contentId. More...
| loadReverseRelationList (int $destinationContentId, int $offset=0, int $limit=-1, ?int $type=null)
  | {Loads paginated relations from $contentId.Optionally, loads only those with $type.Only loads relations against published versions. Parameters
  int | $destinationContentId | Destination Content ID
  int | $offset |
  int | $limit |
  int | null | $type | The relation type bitmask {
See also \eZ\Publish\API\Repository\Values\Content\Relation} Returns \eZ\Publish\SPI\Persistence\Content\Relation[] } More...
| removeTranslationFromContent ($contentId, $languageCode)
  | {Remove the specified translation from all the Versions of a Content Object. Deprecated: since 6.13, use { See also deleteTranslationFromContent} instead Parameters
  int | $contentId |
  string | $languageCode | language code of the translation
} More...
| deleteTranslationFromContent ($contentId, $languageCode)
  | {Delete the specified translation from all the Versions of a Content Object. Parameters
  int | $contentId |
  string | $languageCode | language code of the translation
} More...
| deleteTranslationFromDraft ($contentId, $versionNo, $languageCode)
  | {Remove the specified Translation from the given Version Draft of a Content Object. Parameters
  int | $contentId |
  int | $versionNo |
  string | $languageCode |
Returns \eZ\Publish\SPI\Persistence\Content The Content Draft w/o removed Translation } More...
Public Member Functions inherited from eZ\Publish\SPI\Persistence\Content\Handler
| updateContent ($contentId, $versionNo, UpdateStruct $content)
| Updates a content version, identified by $contentId and $versionNo. More...

## Protected Member Functions
| internalCreate (CreateStruct $struct, $versionNo=1)
| Creates a new Content entity in the storage engine. More...
| updatePathIdentificationString ($contentId, MetadataUpdateStruct $content)
| Updates path identification string for locations of given $contentId if main language is set in update struct. More...

## Protected Attributes
| $contentGateway
| $locationGateway
| $mapper
| $fieldHandler
| $slugConverter
| $urlAliasGateway
| $contentTypeHandler
| $treeHandler

## Private Attributes
| $logger

## Detailed Description

The Content Handler stores Content and ContentType objects.

Definition at line 29 of file Core/Persistence/Legacy/Content/Handler.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::__construct | ( | Gateway | $contentGateway,
|  | LocationGateway | $locationGateway,
|  | Mapper | $mapper,
|  | FieldHandler | $fieldHandler,
|  | SlugConverter | $slugConverter,
|  | UrlAliasGateway | $urlAliasGateway,
|  | ContentTypeHandler | $contentTypeHandler,
|  | TreeHandler | $treeHandler,
|  | LoggerInterface | $logger = `null`
| ) |  |

Creates a new content handler.

Parameters

  \eZ\Publish\Core\Persistence\Legacy\Content\Gateway | $contentGateway |
  \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway | $locationGateway |
  \eZ\Publish\Core\Persistence\Legacy\Content\Mapper | $mapper |
  \eZ\Publish\Core\Persistence\Legacy\Content\FieldHandler | $fieldHandler |
  \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\SlugConverter | $slugConverter |
  \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Gateway | $urlAliasGateway |
  \eZ\Publish\SPI\Persistence\Content\Type\Handler | $contentTypeHandler |
  \eZ\Publish\Core\Persistence\Legacy\Content\TreeHandler | $treeHandler |
  \Psr\Log\LoggerInterface | null | $logger |

Definition at line 103 of file Core/Persistence/Legacy/Content/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Handler\$contentGateway, eZ\Publish\Core\Persistence\Legacy\Content\Handler\$contentTypeHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler\$fieldHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler\$locationGateway, eZ\Publish\Core\Persistence\Legacy\Content\Handler\$logger, eZ\Publish\Core\Persistence\Legacy\Content\Handler\$mapper, eZ\Publish\Core\Persistence\Legacy\Content\Handler\$slugConverter, eZ\Publish\Core\Persistence\Legacy\Content\Handler\$treeHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Handler\$urlAliasGateway.

## Member Function Documentation

## ◆ addRelation()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::addRelation | ( | RelationCreateStruct | $createStruct | ) |

Creates a relation between $sourceContentId in $sourceContentVersionNo and $destinationContentId with a specific $type.

Todo:
  Should the existence verifications happen here or is this supposed to be handled at a higher level?

Parameters

  \eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct | $createStruct |

Returns
  \eZ\Publish\SPI\Persistence\Content\Relation

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 780 of file Core/Persistence/Legacy/Content/Handler.php.

## ◆ copy()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::copy | ( |  | $contentId,
|  |  | $versionNo = `null`,
|  |  | $newOwnerId = `null`
| ) |  |

Copy Content with Fields, Versions & Relations from $contentId in $version.

{Copy Content with Fields, Versions & Relations from $contentId in $version.Copies all fields and relations from $contentId in $version (or all versions if false) to a new object which is returned. Version numbers are maintained.

Exceptions

}

Exceptions

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 711 of file Core/Persistence/Legacy/Content/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Handler\internalCreate(), eZ\Publish\Core\Persistence\Legacy\Content\Handler\listVersions(), eZ\Publish\Core\Persistence\Legacy\Content\Handler\load(), and eZ\Publish\Core\Persistence\Legacy\Content\Handler\loadContentInfo().

## ◆ countDraftsForUser()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::countDraftsForUser | ( | int | $userId | ) |

Returns the number of versions with draft status created by the given $userId.

Parameters

  int | $userId |

Returns
  int

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 474 of file Core/Persistence/Legacy/Content/Handler.php.

References eZ\Publish\SPI\Persistence\Content\VersionInfo\STATUS_DRAFT.

## ◆ countReverseRelations()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::countReverseRelations | ( | int | $destinationContentId,
|  | ?int | $type = `null`
| ) |  |

{Counts relations from $destinationContentId only against published versions.Optionally, count only those with $type.

Parameters

  int | $destinationContentId | Destination Content ID
  int | null | $type | The relation type bitmask {

See also
  \eZ\Publish\API\Repository\Values\Content\Relation}

Returns
  int

}

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 827 of file Core/Persistence/Legacy/Content/Handler.php.

## ◆ create()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::create | ( | CreateStruct | $struct | ) |

Creates a new Content entity in the storage engine.

The values contained inside the $content will form the basis of stored entity.

Will contain always a complete list of fields.

Parameters

  \eZ\Publish\SPI\Persistence\Content\CreateStruct | $struct | Content creation struct.

Returns
  \eZ\Publish\SPI\Persistence\Content Content value object

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 137 of file Core/Persistence/Legacy/Content/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Handler\internalCreate().

## ◆ createDraftFromVersion()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::createDraftFromVersion | ( |  | $contentId,
|  |  | $srcVersion,
|  |  | $userId,
|  | ?string | $languageCode = `null`
| ) |  |

Creates a new draft version from $contentId in $version.

Copies all fields from $contentId in $srcVersion and creates a new version of the referred Content from it.

Note: When creating a new draft in the old admin interface there will also be an entry in the `eznode_assignment` created for the draft. This is ignored in this implementation.

Parameters

  mixed | $contentId |
  mixed | $srcVersion |
  mixed | $userId |
  string | null | $languageCode |

Returns
  \eZ\Publish\SPI\Persistence\Content

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 259 of file Core/Persistence/Legacy/Content/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Handler\load().

## ◆ deleteContent()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::deleteContent | ( |  | $contentId | ) |

Deletes all versions and fields, all locations (subtree), and all relations.

Removes the relations, but not the related objects. All subtrees of the assigned nodes of this content objects are removed (recursively).

Parameters

  int | $contentId |

Returns
  bool

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 637 of file Core/Persistence/Legacy/Content/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Handler\removeRawContent().

## ◆ deleteTranslationFromContent()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::deleteTranslationFromContent | ( |  | $contentId,
|  |  | $languageCode
| ) |  |

{Delete the specified translation from all the Versions of a Content Object.

Parameters

  int | $contentId |
  string | $languageCode | language code of the translation

}

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 881 of file Core/Persistence/Legacy/Content/Handler.php.

## ◆ deleteTranslationFromDraft()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::deleteTranslationFromDraft | ( |  | $contentId,
|  |  | $versionNo,
|  |  | $languageCode
| ) |  |

{Remove the specified Translation from the given Version Draft of a Content Object.

Parameters

  int | $contentId |
  int | $versionNo |
  string | $languageCode |

Returns
  \eZ\Publish\SPI\Persistence\Content The Content Draft w/o removed Translation

}

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 894 of file Core/Persistence/Legacy/Content/Handler.php.

## ◆ deleteVersion()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::deleteVersion | ( |  | $contentId,
|  |  | $versionNo
| ) |  |

Deletes given version, its fields, node assignment, relations and names.

Removes the relations, but not the related objects.

Parameters

  int | $contentId |
  int | $versionNo |

Returns
  bool

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 669 of file Core/Persistence/Legacy/Content/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Handler\loadVersionInfo().

## ◆ internalCreate()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::internalCreate | ( | CreateStruct | $struct,
|  |  | $versionNo = `1`
| ) |  |
| protected

Creates a new Content entity in the storage engine.

The values contained inside the $content will form the basis of stored entity.

Will contain always a complete list of fields.

Parameters

  \eZ\Publish\SPI\Persistence\Content\CreateStruct | $struct | Content creation struct.
  mixed | $versionNo | Used by self::copy() to maintain version numbers

Returns
  \eZ\Publish\SPI\Persistence\Content Content value object

Definition at line 155 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\copy(), and eZ\Publish\Core\Persistence\Legacy\Content\Handler\create().

## ◆ listVersions()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::listVersions | ( |  | $contentId,
|  |  | $status = `null`,
|  |  | $limit = `-1`
| ) |  |

Returns the versions for $contentId.

Result is returned with oldest version first (sorted by created, alternatively version id if auto increment).

Parameters

  int | $contentId |
  mixed | null | $status | Optional argument to filter versions by status, like {

See also
  VersionInfo::STATUS_ARCHIVED}.

Parameters

  int | $limit | Limit for items returned, -1 means none.

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

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 693 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\copy().

## ◆ load()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::load | ( |  | $id,
|  |  | $version = `null`,
|  | array | $translations = `null`
| ) |  |

{Returns the raw data of a content object identified by $id, in a struct.If you want to load current version, $version number can be omitted to make sure you don't need to rely on search index (async) or having to load in two steps (first content info then content, risking changes in between to current version).Optionally a translation filter may be specified. If specified only the translations with the listed language codes will be retrieved. If not, all translations will be retrieved.

Parameters

  int | string | $id |
  int | null | $version |
  string[] | null | $translations |

Returns
  \eZ\Publish\SPI\Persistence\Content Content value object

}

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 310 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\copy(), eZ\Publish\Core\Persistence\Legacy\Content\Handler\createDraftFromVersion(), eZ\Publish\Core\Persistence\Legacy\Content\Handler\publish(), and eZ\Publish\Core\Persistence\Legacy\Content\Handler\updateContent().

## ◆ loadContentInfo()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadContentInfo | ( |  | $contentId | ) |

Returns the metadata object for a content identified by $contentId.

Parameters

  int | string | $contentId |

Returns
  \eZ\Publish\SPI\Persistence\Content\ContentInfo

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 416 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\copy(), and eZ\Publish\Core\Persistence\Legacy\Content\Handler\updateMetadata().

## ◆ loadContentInfoByRemoteId()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadContentInfoByRemoteId | ( |  | $remoteId | ) |

Returns the metadata object for a content identified by $remoteId.

Parameters

  mixed | $remoteId |

Returns
  \eZ\Publish\SPI\Persistence\Content\ContentInfo

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 442 of file Core/Persistence/Legacy/Content/Handler.php.

## ◆ loadContentInfoList()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadContentInfoList | ( | array | $contentIds | ) |

Return list of unique Content Info, with content 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 | $contentIds |

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

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 421 of file Core/Persistence/Legacy/Content/Handler.php.

## ◆ loadContentList()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadContentList | ( | array | $contentIds,
|  | array | $translations = `null`
| ) |  |

{Return list of unique Content, with content 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.If items are missing but for other reasons then not being found, for instance exceptions during loading field data. Then the exception will be logged as warning or error depending on severity. The most common case of possible exceptions during loading of Content data is migration, where either custom Field Type configuration or implementation might not be aligned with new version of the system.NOTE!!: If you want to take always available flag into account, append main language to the list of languages(unless caller is asking for all languages). In some edge cases you'll end up with a bit more data returned, but upside is that storage engine is able to handle far larger datasets.

Parameters

  int[] | $contentIds |
  string[] | null | $translations |

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

}

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 336 of file Core/Persistence/Legacy/Content/Handler.php.

## ◆ loadDraftListForUser()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadDraftListForUser | ( | int | $userId,
|  | int | $offset = `0`,
|  | int | $limit = `-1`
| ) |  |

{Loads drafts for a user when content is not in the trash.The list is sorted by modification date.

Parameters

  int | $userId |
  int | $offset |
  int | $limit |

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

}

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 510 of file Core/Persistence/Legacy/Content/Handler.php.

References eZ\Publish\SPI\Persistence\Content\VersionInfo\STATUS_DRAFT.

## ◆ loadDraftsForUser()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadDraftsForUser | ( |  | $userId | ) |

Returns all versions with draft status created by the given $userId.

Parameters

  int | $userId |

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

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 486 of file Core/Persistence/Legacy/Content/Handler.php.

References eZ\Publish\SPI\Persistence\Content\VersionInfo\STATUS_DRAFT.

## ◆ loadRelations()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadRelations | ( |  | $sourceContentId,
|  |  | $sourceContentVersionNo = `null`,
|  |  | $type = `null`
| ) |  |

Loads relations from $sourceContentId.

Optionally, loads only those with $type and $sourceContentVersionNo.

Parameters

  mixed | $sourceContentId | Source Content ID
  mixed | null | $sourceContentVersionNo | Source Content Version, null if not specified
  int | null | $type | {

See also
  \eZ\Publish\API\Repository\Values\Content\Relation::COMMON, \eZ\Publish\API\Repository\Values\Content\Relation::EMBED, \eZ\Publish\API\Repository\Values\Content\Relation::LINK, \eZ\Publish\API\Repository\Values\Content\Relation::FIELD}

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

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 817 of file Core/Persistence/Legacy/Content/Handler.php.

## ◆ loadReverseRelationList()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadReverseRelationList | ( | int | $destinationContentId,
|  | int | $offset = `0`,
|  | int | $limit = `-1`,
|  | ?int | $type = `null`
| ) |  |

{Loads paginated relations from $contentId.Optionally, loads only those with $type.Only loads relations against published versions.

Parameters

  int | $destinationContentId | Destination Content ID
  int | $offset |
  int | $limit |
  int | null | $type | The relation type bitmask {

See also
  \eZ\Publish\API\Repository\Values\Content\Relation}

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

}

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 855 of file Core/Persistence/Legacy/Content/Handler.php.

## ◆ loadReverseRelations()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadReverseRelations | ( |  | $destinationContentId,
|  |  | $type = `null`
| ) |  |

Loads relations from $contentId.

Optionally, loads only those with $type.

Only loads relations against published versions.

Parameters

  mixed | $destinationContentId | Destination Content ID
  int | null | $type | {

See also
  \eZ\Publish\API\Repository\Values\Content\Relation::COMMON, \eZ\Publish\API\Repository\Values\Content\Relation::EMBED, \eZ\Publish\API\Repository\Values\Content\Relation::LINK, \eZ\Publish\API\Repository\Values\Content\Relation::FIELD}

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

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 845 of file Core/Persistence/Legacy/Content/Handler.php.

## ◆ loadVersionInfo()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadVersionInfo | ( |  | $contentId,
|  |  | $versionNo = `null`
| ) |  |

{Returns the version object for a content/version identified by $contentId and $versionNo.

Exceptions

}

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 452 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\deleteVersion(), and eZ\Publish\Core\Persistence\Legacy\Content\Handler\publish().

## ◆ publish()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::publish | ( |  | $contentId,
|  |  | $versionNo,
|  | MetadataUpdateStruct | $metaDataUpdateStruct
| ) |  |

Performs the publishing operations required to set the version identified by $updateStruct->versionNo and $updateStruct->id as the published one.

The publish procedure will:

- Create location nodes based on the node assignments
- Update the content object using the provided metadata update struct
- Update the node assignments
- Update location nodes of the content with the new published version
- Set content and version status to published

Parameters

  int | $contentId |
  int | $versionNo |
  \eZ\Publish\SPI\Persistence\Content\MetadataUpdateStruct | $metaDataUpdateStruct |

Returns
  \eZ\Publish\SPI\Persistence\Content The published Content

Exceptions

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 215 of file Core/Persistence/Legacy/Content/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Handler\load(), eZ\Publish\Core\Persistence\Legacy\Content\Handler\loadVersionInfo(), eZ\Publish\Core\Persistence\Legacy\Content\Handler\setStatus(), and eZ\Publish\SPI\Persistence\Content\VersionInfo\STATUS_ARCHIVED.

## ◆ removeRawContent()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::removeRawContent | ( |  | $contentId | ) |

Deletes raw content data.

Parameters

  int | $contentId |

Definition at line 654 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\deleteContent().

## ◆ removeRelation()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::removeRelation | ( |  | $relationId,
|  |  | $type
| ) |  |

Removes a relation by relation Id.

Todo:
  Should the existence verifications happen here or is this supposed to be handled at a higher level?

Parameters

  mixed | $relationId |
  int | $type | {

See also
  \eZ\Publish\API\Repository\Values\Content\Relation::COMMON, \eZ\Publish\API\Repository\Values\Content\Relation::EMBED, \eZ\Publish\API\Repository\Values\Content\Relation::LINK, \eZ\Publish\API\Repository\Values\Content\Relation::FIELD}

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 800 of file Core/Persistence/Legacy/Content/Handler.php.

## ◆ removeTranslationFromContent()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::removeTranslationFromContent | ( |  | $contentId,
|  |  | $languageCode
| ) |  |

{Remove the specified translation from all the Versions of a Content Object.

Deprecated:
  since 6.13, use {

See also
  deleteTranslationFromContent} instead

Parameters

  int | $contentId |
  string | $languageCode | language code of the translation

}

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 869 of file Core/Persistence/Legacy/Content/Handler.php.

## ◆ setStatus()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::setStatus | ( |  | $contentId,
|  |  | $status,
|  |  | $version
| ) |  |

Sets the status of object identified by $contentId and $version to $status.

The $status can be one of VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_PUBLISHED, VersionInfo::STATUS_ARCHIVED When status is set to VersionInfo::STATUS_PUBLISHED content status is updated to ContentInfo::STATUS_PUBLISHED

Parameters

  int | $contentId |
  int | $status |
  int | $version |

Returns
  bool

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 543 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\publish().

## ◆ updateContent()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::updateContent | ( |  | $contentId,
|  |  | $versionNo,
|  | UpdateStruct | $updateStruct
| ) |  |

Updates a content version, identified by $contentId and $versionNo.

Parameters

  int | $contentId |
  int | $versionNo |
  \eZ\Publish\SPI\Persistence\Content\UpdateStruct | $updateStruct |

Returns
  \eZ\Publish\SPI\Persistence\Content

Definition at line 609 of file Core/Persistence/Legacy/Content/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Handler\load().

## ◆ updateMetadata()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::updateMetadata | ( |  | $contentId,
|  | MetadataUpdateStruct | $content
| ) |  |

Updates a content object meta data, identified by $contentId.

Parameters

  int | $contentId |
  \eZ\Publish\SPI\Persistence\Content\MetadataUpdateStruct | $content |

Returns
  \eZ\Publish\SPI\Persistence\Content\ContentInfo

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Definition at line 556 of file Core/Persistence/Legacy/Content/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Handler\loadContentInfo(), and eZ\Publish\Core\Persistence\Legacy\Content\Handler\updatePathIdentificationString().

## ◆ updatePathIdentificationString()

eZ\Publish\Core\Persistence\Legacy\Content\Handler::updatePathIdentificationString | ( |  | $contentId,
|  | MetadataUpdateStruct | $content
| ) |  |
| protected

Updates path identification string for locations of given $contentId if main language is set in update struct.

This is specific to the Legacy storage engine, as path identification string is deprecated.

Parameters

  int | $contentId |
  \eZ\Publish\SPI\Persistence\Content\MetadataUpdateStruct | $content |

Definition at line 573 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\updateMetadata().

## Member Data Documentation

## ◆ $contentGateway

eZ\Publish\Core\Persistence\Legacy\Content\Handler::$contentGateway
| protected

Definition at line 36 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\__construct().

## ◆ $contentTypeHandler

eZ\Publish\Core\Persistence\Legacy\Content\Handler::$contentTypeHandler
| protected

Definition at line 78 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\__construct().

## ◆ $fieldHandler

eZ\Publish\Core\Persistence\Legacy\Content\Handler::$fieldHandler
| protected

Definition at line 57 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\__construct().

## ◆ $locationGateway

eZ\Publish\Core\Persistence\Legacy\Content\Handler::$locationGateway
| protected

Definition at line 43 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\__construct().

## ◆ $logger

eZ\Publish\Core\Persistence\Legacy\Content\Handler::$logger
| private

Definition at line 88 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\__construct().

## ◆ $mapper

eZ\Publish\Core\Persistence\Legacy\Content\Handler::$mapper
| protected

Definition at line 50 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\__construct().

## ◆ $slugConverter

eZ\Publish\Core\Persistence\Legacy\Content\Handler::$slugConverter
| protected

Definition at line 64 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\__construct().

## ◆ $treeHandler

eZ\Publish\Core\Persistence\Legacy\Content\Handler::$treeHandler
| protected

Definition at line 85 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\__construct().

## ◆ $urlAliasGateway

eZ\Publish\Core\Persistence\Legacy\Content\Handler::$urlAliasGateway
| protected

Definition at line 71 of file Core/Persistence/Legacy/Content/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Handler\__construct().

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

- Core/Persistence/Legacy/Content/Handler.php

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