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\Core\Persistence\Legacy\Content\Gateway Class Reference

Base class for content gateways. More...

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

## Public Member Functions
| getContext ()
| Get context definition for external storage layers. More...
| insertContentObject (CreateStruct $struct, $currentVersionNo=1)
| Inserts a new content object. More...
| insertVersion (VersionInfo $versionInfo, array $fields)
| Inserts a new version. More...
| updateContent ( $contentId, MetadataUpdateStruct $struct, VersionInfo $prePublishVersionInfo=null)
| Updates an existing content identified by $contentId in respect to $struct. More...
| updateVersion ($contentId, $versionNo, UpdateStruct $struct)
| Updates version $versionNo for content identified by $contentId, in respect to $struct. More...
| updateAlwaysAvailableFlag ($contentId, $newAlwaysAvailable)
| Updates "always available" flag for content identified by $contentId, in respect to $alwaysAvailable. More...
| setStatus ($contentId, $version, $status)
| Sets the state of object identified by $contentId and $version to $state. More...
| setPublishedStatus (int $contentId, int $status)
| Dedicated operation which sets Version status as published, similar to setStatus, but checking state of all versions to avoid race conditions. More...
| insertNewField (Content $content, Field $field, StorageFieldValue $value)
| Inserts a new field. More...
| insertExistingField (Content $content, Field $field, StorageFieldValue $value)
| Inserts an existing field. More...
| updateField (Field $field, StorageFieldValue $value)
| Updates an existing field. More...
| updateNonTranslatableField (Field $field, StorageFieldValue $value, $contentId)
| Updates an existing, non-translatable field. More...
| load ($contentId, $version=null, array $translations=null)
| Loads data for a content object. More...
| loadContentList (array $contentIds, array $translations=null)
| Loads current version for a list of content objects. More...
| loadContentInfoByRemoteId ($remoteId)
| Loads info for a content object identified by its remote ID. More...
| loadContentInfoByLocationId ($locationId)
| Loads info for a content object identified by its location ID (node ID). More...
| loadContentInfo ($contentId)
| Loads info for content identified by $contentId. More...
| loadContentInfoList (array $contentIds)
| Loads rows of info for content identified by $contentIds. More...
| loadVersionInfo ($contentId, $versionNo=null)
| Loads version info for content identified by $contentId and $versionNo. More...
| countVersionsForUser (int $userId, int $status=VersionInfo::STATUS_DRAFT)
| Returns the number of all versions with given status created by the given $userId. More...
| listVersionsForUser ($userId, $status=VersionInfo::STATUS_DRAFT)
| Returns data for all versions with given status created by the given $userId. More...
| loadVersionsForUser ($userId, $status=VersionInfo::STATUS_DRAFT, int $offset=0, int $limit=-1)
| Returns data for all versions with given status created by the given $userId when content is not in the trash. More...
| listVersions ($contentId, $status=null, $limit=-1)
| Returns all version data for the given $contentId. More...
| listVersionNumbers ($contentId)
| Returns all version numbers for the given $contentId. More...
| getLastVersionNumber ($contentId)
| Returns last version number for content identified by $contentId. More...
| getAllLocationIds ($contentId)
| Returns all IDs for locations that refer to $contentId. More...
| getFieldIdsByType ($contentId, $versionNo=null, $languageCode=null)
| Returns all field IDs of $contentId grouped by their type. More...
| deleteRelations ($contentId, $versionNo=null)
| Deletes relations to and from $contentId. More...
| removeReverseFieldRelations ($contentId)
| Removes relations to Content with $contentId from Relation and RelationList field type fields. More...
| removeRelationsByFieldDefinitionId (int $fieldDefinitionId)
| Removes orphaned relations resulting from deleted relation fieldtype. More...
| deleteField ($fieldId)
| Deletes the field with the given $fieldId. More...
| deleteFields ($contentId, $versionNo=null)
| Deletes all fields of $contentId in all versions. More...
| deleteVersions ($contentId, $versionNo=null)
| Deletes all versions of $contentId. More...
| deleteNames ($contentId, $versionNo=null)
| Deletes all names of $contentId. More...
| setName ($contentId, $version, $name, $language)
| Sets the content object name. More...
| deleteContent ($contentId)
| Deletes the actual content object referred to by $contentId. More...
| loadRelations ($contentId, $contentVersionNo=null, $relationType=null)
| Loads data of related to/from $contentId. More...
| countReverseRelations (int $contentId, ?int $relationType=null)
| Counts number of related to/from $contentId. More...
| loadReverseRelations ($contentId, $relationType=null)
| Loads data of related to/from $contentId. More...
| listReverseRelations (int $contentId, int $offset=0, int $limit=-1, ?int $relationType=null)
| Loads paginated data of related to/from $contentId. More...
| deleteRelation ($relationId, $type)
| Deletes the relation with the given $relationId. More...
| insertRelation (RelationCreateStruct $createStruct)
| Inserts a new relation database record. More...
| getContentIdsByContentTypeId ($contentTypeId)
| Returns all Content IDs for a given $contentTypeId. More...
| loadVersionedNameData ($rows)
| Load name data for set of content id's and corresponding version number. More...
| copyRelations ($originalContentId, $copiedContentId, $versionNo=null)
| Batch method for copying all relation meta data for copied Content object. More...
| deleteTranslationFromContent ($contentId, $languageCode)
| Remove the specified translation from all the Versions of a Content Object. More...
| deleteTranslatedFields ($languageCode, $contentId, $versionNo=null)
| Delete Content fields (attributes) for the given Translation. More...
| deleteTranslationFromVersion ($contentId, $versionNo, $languageCode)
| Delete the specified Translation from the given Version. More...

## Detailed Description

Base class for content gateways.

Definition at line 20 of file Persistence/Legacy/Content/Gateway.php.

## Member Function Documentation

## ◆ copyRelations()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::copyRelations | ( |  | $originalContentId,
|  |  | $copiedContentId,
|  |  | $versionNo = `null`
| ) |  |
| abstract

Batch method for copying all relation meta data for copied Content object.

Is meant to be used during content copy, so assumes the following:

- version number is the same
- content type, and hence content type attribute is the same
- relation type is the same
- target relation is the same

Parameters

  int | $originalContentId |
  int | $copiedContentId |
  int | null | $versionNo | If specified only copy for a given version number, otherwise all.

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ countReverseRelations()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::countReverseRelations | ( | int | $contentId,
|  | ?int | $relationType = `null`
| ) |  |
| abstract

Counts number of related to/from $contentId.

Parameters

  int | $contentId |
  int | null | $relationType |

Returns
  int

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion.

## ◆ countVersionsForUser()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::countVersionsForUser | ( | int | $userId,
|  | int | $status = `VersionInfo::STATUS_DRAFT`
| ) |  |
| abstract

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

Parameters

  int | $userId |
  int | $status |

Returns
  int

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ deleteContent()

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

Deletes the actual content object referred to by $contentId.

Parameters

  int | $contentId |

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ deleteField()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::deleteField | ( |  | $fieldId | ) |
| abstract

Deletes the field with the given $fieldId.

Parameters

  int | $fieldId |

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ deleteFields()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::deleteFields | ( |  | $contentId,
|  |  | $versionNo = `null`
| ) |  |
| abstract

Deletes all fields of $contentId in all versions.

If $versionNo is set only fields for that version are deleted.

Parameters

  int | $contentId |
  int | null | $versionNo |

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ deleteNames()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::deleteNames | ( |  | $contentId,
|  |  | $versionNo = `null`
| ) |  |
| abstract

Deletes all names of $contentId.

If $versionNo is set only names for that version are deleted.

Parameters

  int | $contentId |
  int | null | $versionNo |

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ deleteRelation()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::deleteRelation | ( |  | $relationId,
|  |  | $type
| ) |  |
| abstract

Deletes the relation with the given $relationId.

Parameters

  int | $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}

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion.

## ◆ deleteRelations()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::deleteRelations | ( |  | $contentId,
|  |  | $versionNo = `null`
| ) |  |
| abstract

Deletes relations to and from $contentId.

If $versionNo is set only relations for that version are deleted.

Parameters

  int | $contentId |
  int | null | $versionNo |

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ deleteTranslatedFields()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::deleteTranslatedFields | ( |  | $languageCode,
|  |  | $contentId,
|  |  | $versionNo = `null`
| ) |  |
| abstract

Delete Content fields (attributes) for the given Translation.

If $versionNo is given, fields for that Version only will be deleted.

Parameters

  string | $languageCode |
  int | $contentId |
  int | $versionNo | (optional) filter by versionNo

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ deleteTranslationFromContent()

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

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

Parameters

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

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ deleteTranslationFromVersion()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::deleteTranslationFromVersion | ( |  | $contentId,
|  |  | $versionNo,
|  |  | $languageCode
| ) |  |
| abstract

Delete the specified Translation from the given Version.

Parameters

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

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ deleteVersions()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::deleteVersions | ( |  | $contentId,
|  |  | $versionNo = `null`
| ) |  |
| abstract

Deletes all versions of $contentId.

If $versionNo is set only that version is deleted.

Parameters

  int | $contentId |
  int | null | $versionNo |

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ getAllLocationIds()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::getAllLocationIds | ( |  | $contentId | ) |
| abstract

Returns all IDs for locations that refer to $contentId.

Parameters

  int | $contentId |

Returns
  int[]

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ getContentIdsByContentTypeId()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::getContentIdsByContentTypeId | ( |  | $contentTypeId | ) |
| abstract

Returns all Content IDs for a given $contentTypeId.

Parameters

  int | $contentTypeId |

Returns
  int[]

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ getContext()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::getContext | ( |  | ) |
| abstract

Get context definition for external storage layers.

Returns
  array

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ getFieldIdsByType()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::getFieldIdsByType | ( |  | $contentId,
|  |  | $versionNo = `null`,
|  |  | $languageCode = `null`
| ) |  |
| abstract

Returns all field IDs of $contentId grouped by their type.

If $versionNo is set only field IDs for that version are returned. If $languageCode is set, only field IDs for that language are returned.

Parameters

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

Returns
  int[][]

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ getLastVersionNumber()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::getLastVersionNumber | ( |  | $contentId | ) |
| abstract

Returns last version number for content identified by $contentId.

Parameters

  int | $contentId |

Returns
  int

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ insertContentObject()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::insertContentObject | ( | CreateStruct | $struct,
|  |  | $currentVersionNo = `1`
| ) |  |
| abstract

Inserts a new content object.

Parameters

  \eZ\Publish\SPI\Persistence\Content\CreateStruct | $struct |
  mixed | $currentVersionNo |

Returns
  int ID

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ insertExistingField()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::insertExistingField | ( | Content | $content,
|  | Field | $field,
|  | StorageFieldValue | $value
| ) |  |
| abstract

Inserts an existing field.

Used to insert a field with an existing ID but a new version number.

Parameters

  Content | $content |
  Field | $field |
  StorageFieldValue | $value |

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ insertNewField()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::insertNewField | ( | Content | $content,
|  | Field | $field,
|  | StorageFieldValue | $value
| ) |  |
| abstract

Inserts a new field.

Only used when a new field is created (i.e. a new object or a field in a new language!). After that, field IDs need to stay the same, only the version number changes.

Parameters

  \eZ\Publish\SPI\Persistence\Content | $content |
  \eZ\Publish\SPI\Persistence\Content\Field | $field |
  \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue | $value |

Returns
  int ID

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ insertRelation()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::insertRelation | ( | RelationCreateStruct | $createStruct | ) |
| abstract

Inserts a new relation database record.

Parameters

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

Returns
  int ID the inserted ID

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ insertVersion()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::insertVersion | ( | VersionInfo | $versionInfo,
|  | array | $fields
| ) |  |
| abstract

Inserts a new version.

Parameters

  \eZ\Publish\SPI\Persistence\Content\VersionInfo | $versionInfo |
  \eZ\Publish\SPI\Persistence\Content\Field[] | $fields |

Returns
  int ID

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion.

## ◆ listReverseRelations()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::listReverseRelations | ( | int | $contentId,
|  | int | $offset = `0`,
|  | int | $limit = `-1`,
|  | ?int | $relationType = `null`
| ) |  |
| abstract

Loads paginated data of related to/from $contentId.

Parameters

  int | $contentId |
  int | $offset |
  int | $limit |
  int | null | $relationType |

Returns
  array

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion.

## ◆ listVersionNumbers()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::listVersionNumbers | ( |  | $contentId | ) |
| abstract

Returns all version numbers for the given $contentId.

Parameters

  mixed | $contentId |

Returns
  int[]

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ listVersions()

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

Returns all version data for the given $contentId.

Result is returned with oldest version first (using version id as it has index and is auto increment).

Parameters

  mixed | $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
  string[][]

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ listVersionsForUser()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::listVersionsForUser | ( |  | $userId,
|  |  | $status = `VersionInfo::STATUS_DRAFT`
| ) |  |
| abstract

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

Parameters

  int | $userId |
  int | $status |

Returns
  string[][]

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ load()

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

Loads data for a content object.

Returns an array with the relevant data.

Parameters

  mixed | $contentId |
  int | null | $version | Current version on null value.
  string[] | $translations |

Returns
  array

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ loadContentInfo()

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

Loads info for content identified by $contentId.

Will basically return a hash containing all field values for ezcontentobject table plus following keys:

- always_available => Boolean indicating if content's language mask contains alwaysAvailable bit field
- main_language_code => Language code for main (initial) language. E.g. "eng-GB".

Parameters

  int | $contentId |

Exceptions

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ loadContentInfoByLocationId()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::loadContentInfoByLocationId | ( |  | $locationId | ) |
| abstract

Loads info for a content object identified by its location ID (node ID).

Returns an array with the relevant data.

Parameters

  int | $locationId |

Exceptions

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ loadContentInfoByRemoteId()

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

Loads info for a content object identified by its remote ID.

Returns an array with the relevant data.

Parameters

  mixed | $remoteId |

Returns
  array

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ loadContentInfoList()

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

Loads rows of info for content identified by $contentIds.

See also
  loadContentInfo For the returned structure.
  \eZ\Publish\SPI\Persistence\Content\Handler::loadContentInfoList For how this will only return items found and not throw.

Parameters

  array | $contentIds |

Returns
  array[]

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ loadContentList()

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

Loads current version for a list of content objects.

Parameters

  int[] | $contentIds |
  string[] | null | $translations | If languages is not set, ALL will be loaded.

Returns
  array[]

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ loadRelations()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::loadRelations | ( |  | $contentId,
|  |  | $contentVersionNo = `null`,
|  |  | $relationType = `null`
| ) |  |
| abstract

Loads data of related to/from $contentId.

Parameters

  int | $contentId |
  int | $contentVersionNo |
  int | $relationType |

Returns
  mixed[][] Content data, array structured like {

See also
  \eZ\Publish\Core\Persistence\Legacy\Content\Gateway::load()}

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ loadReverseRelations()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::loadReverseRelations | ( |  | $contentId,
|  |  | $relationType = `null`
| ) |  |
| abstract

Loads data of related to/from $contentId.

Parameters

  int | $contentId |
  int | $relationType |

Returns
  mixed[][] Content data, array structured like {

See also
  \eZ\Publish\Core\Persistence\Legacy\Content\Gateway::load()}

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion.

## ◆ loadVersionedNameData()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::loadVersionedNameData | ( |  | $rows | ) |
| abstract

Load name data for set of content id's and corresponding version number.

Parameters

  array[] | $rows | array of hashes with 'id' and 'version' to load names for

Returns
  array

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ loadVersionInfo()

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

Loads version info for content identified by $contentId and $versionNo.

Will basically return a hash containing all field values from ezcontentobject_version table plus following keys:

- names => Hash of content object names. Key is the language code, value is the name.
- languages => Hash of language ids. Key is the language code (e.g. "eng-GB"), value is the language numeric id without the always available bit.
- initial_language_code => Language code for initial language in this version.

Parameters

  int | $contentId |
  int | null | $versionNo | Load current version if null.

Returns
  array

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ loadVersionsForUser()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::loadVersionsForUser | ( |  | $userId,
|  |  | $status = `VersionInfo::STATUS_DRAFT`,
|  | int | $offset = `0`,
|  | int | $limit = `-1`
| ) |  |
| abstract

Returns data for all versions with given status created by the given $userId when content is not in the trash.

The list is sorted by modification date.

Parameters

  int | $userId |
  int | $status |

Returns
  string[][]

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ removeRelationsByFieldDefinitionId()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::removeRelationsByFieldDefinitionId | ( | int | $fieldDefinitionId | ) |
| abstract

Removes orphaned relations resulting from deleted relation fieldtype.

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ removeReverseFieldRelations()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::removeReverseFieldRelations | ( |  | $contentId | ) |
| abstract

Removes relations to Content with $contentId from Relation and RelationList field type fields.

Parameters

  int | $contentId |

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ setName()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::setName | ( |  | $contentId,
|  |  | $version,
|  |  | $name,
|  |  | $language
| ) |  |
| abstract

Sets the content object name.

Parameters

  int | $contentId |
  int | $version |
  string | $name |
  string | $language |

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ setPublishedStatus()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::setPublishedStatus | ( | int | $contentId,
|  | int | $status
| ) |  |
| abstract

Dedicated operation which sets Version status as published, similar to setStatus, but checking state of all versions to avoid race conditions.

IMPORTANT: This method expects prior published version to have been set to another status then published before called, otherwise you'll get a BadStateException.

See also
  setStatus

Exceptions

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion.

## ◆ setStatus()

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

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

The $status can be one of STATUS_DRAFT, STATUS_PUBLISHED, STATUS_ARCHIVED

Parameters

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

Returns
  bool

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ updateAlwaysAvailableFlag()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::updateAlwaysAvailableFlag | ( |  | $contentId,
|  |  | $newAlwaysAvailable
| ) |  |
| abstract

Updates "always available" flag for content identified by $contentId, in respect to $alwaysAvailable.

Parameters

  int | $contentId |
  bool | $newAlwaysAvailable | New "always available" value

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase\updateContent().

## ◆ updateContent()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::updateContent | ( |  | $contentId,
|  | MetadataUpdateStruct | $struct,
|  | VersionInfo | $prePublishVersionInfo = `null`
| ) |  |
| abstract

Updates an existing content identified by $contentId in respect to $struct.

Parameters

  int | $contentId |
  \eZ\Publish\SPI\Persistence\Content\MetadataUpdateStruct | $struct |
  \eZ\Publish\SPI\Persistence\Content\VersionInfo | $prePublishVersionInfo | Provided on publish

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ updateField()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::updateField | ( | Field | $field,
|  | StorageFieldValue | $value
| ) |  |
| abstract

Updates an existing field.

Parameters

  Field | $field |
  StorageFieldValue | $value |

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ updateNonTranslatableField()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::updateNonTranslatableField | ( | Field | $field,
|  | StorageFieldValue | $value,
|  |  | $contentId
| ) |  |
| abstract

Updates an existing, non-translatable field.

Parameters

  \eZ\Publish\SPI\Persistence\Content\Field | $field |
  \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue | $value |
  int | $contentId |

Reimplemented in eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion, and eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.

## ◆ updateVersion()

eZ\Publish\Core\Persistence\Legacy\Content\Gateway::updateVersion | ( |  | $contentId,
|  |  | $versionNo,
|  | UpdateStruct | $struct
| ) |  |
| abstract

Updates version $versionNo for content identified by $contentId, in respect to $struct.

Parameters

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

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

- Persistence/Legacy/Content/Gateway.php

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