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

API/Repository/ContentService.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\API\Repository;
8
9 use eZ\Publish\API\Repository\Values\Content\ContentDraftList;
10 use eZ\Publish\API\Repository\Values\Content\ContentUpdateStruct;
11 use eZ\Publish\API\Repository\Values\Content\Language;
12 use eZ\Publish\API\Repository\Values\Content\RelationList;
13 use eZ\Publish\API\Repository\Values\ContentType\ContentType;
14 use eZ\Publish\API\Repository\Values\Content\ContentCreateStruct;
15 use eZ\Publish\API\Repository\Values\Content\ContentMetadataUpdateStruct;
16 use eZ\Publish\API\Repository\Values\Content\VersionInfo;
17 use eZ\Publish\API\Repository\Values\Content\ContentInfo;
18 use eZ\Publish\API\Repository\Values\User\User;
19 use eZ\Publish\API\Repository\Values\Content\LocationCreateStruct;
20
26 interface ContentService
27 {
40 public function loadContentInfo($contentId);
41
51 public function loadContentInfoList(array $contentIds): iterable;
52
65 public function loadContentInfoByRemoteId($remoteId);
66
80 public function loadVersionInfo(ContentInfo $contentInfo, $versionNo = null);
81
95 public function loadVersionInfoById($contentId, $versionNo = null);
96
113 public function loadContentByContentInfo(ContentInfo $contentInfo, array $languages = null, $versionNo = null, $useAlwaysAvailable = true);
114
127 public function loadContentByVersionInfo(VersionInfo $versionInfo, array $languages = null, $useAlwaysAvailable = true);
128
145 public function loadContent($contentId, array $languages = null, $versionNo = null, $useAlwaysAvailable = true);
146
163 public function loadContentByRemoteId($remoteId, array $languages = null, $versionNo = null, $useAlwaysAvailable = true);
164
180 public function loadContentListByContentInfo(array $contentInfoList, array $languages = [], $useAlwaysAvailable = true);
181
203 public function createContent(ContentCreateStruct $contentCreateStruct, array $locationCreateStructs = []);
204
218 public function updateContentMetadata(ContentInfo $contentInfo, ContentMetadataUpdateStruct $contentMetadataUpdateStruct);
219
229 public function deleteContent(ContentInfo $contentInfo);
230
247 public function createContentDraft(
248 ContentInfo $contentInfo,
249 VersionInfo $versionInfo = null,
250 User $creator = null,
251 ?Language $language = null
252 );
253
265 public function countContentDrafts(?User $user = null): int;
266
280 public function loadContentDrafts(User $user = null);
281
295 public function loadContentDraftList(?User $user = null, int $offset = 0, int $limit = -1): ContentDraftList;
296
311 public function updateContent(VersionInfo $versionInfo, ContentUpdateStruct $contentUpdateStruct);
312
334 public function publishVersion(VersionInfo $versionInfo, array $translations = Language::ALL);
335
345 public function deleteVersion(VersionInfo $versionInfo);
346
358 public function loadVersions(ContentInfo $contentInfo, ?int $status = null);
359
372 public function copyContent(ContentInfo $contentInfo, LocationCreateStruct $destinationLocationCreateStruct, VersionInfo $versionInfo = null);
373
383 public function loadRelations(VersionInfo $versionInfo);
384
392 public function countReverseRelations(ContentInfo $contentInfo): int;
393
405 public function loadReverseRelations(ContentInfo $contentInfo);
406
420 public function loadReverseRelationList(ContentInfo $contentInfo, int $offset = 0, int $limit = -1): RelationList;
421
436 public function addRelation(VersionInfo $sourceVersion, ContentInfo $destinationContent);
437
448 public function deleteRelation(VersionInfo $sourceVersion, ContentInfo $destinationContent);
449
470 public function removeTranslation(ContentInfo $contentInfo, $languageCode);
471
489 public function deleteTranslation(ContentInfo $contentInfo, $languageCode);
490
512 public function deleteTranslationFromDraft(VersionInfo $versionInfo, $languageCode);
513
524 public function hideContent(ContentInfo $contentInfo): void;
525
534 public function revealContent(ContentInfo $contentInfo): void;
535
546 public function newContentCreateStruct(ContentType $contentType, $mainLanguageCode);
547
553 public function newContentMetadataUpdateStruct();
554
560 public function newContentUpdateStruct();
561 }
eZ\Publish\API\Repository\Values\ContentType\ContentType
Definition: API/Repository/Values/ContentType/ContentType.php:36
eZ\Publish\API\Repository\Values\Content\ContentCreateStruct
Definition: API/Repository/Values/Content/ContentCreateStruct.php:15
eZ\Publish\API\Repository\Values\Content\ContentDraftList
List of content drafts.
Definition: ContentDraftList.php:20
eZ\Publish\API\Repository\Values\Content\ContentInfo
Definition: API/Repository/Values/Content/ContentInfo.php:31
eZ\Publish\API\Repository\Values\Content\ContentMetadataUpdateStruct
With this class data can be provided to update version independent fields of the content.
Definition: ContentMetadataUpdateStruct.php:16
eZ\Publish\API\Repository\Values\Content\ContentUpdateStruct
Definition: API/Repository/Values/Content/ContentUpdateStruct.php:15
eZ\Publish\API\Repository\Values\Content\Language
Definition: API/Repository/Values/Content/Language.php:20
eZ\Publish\API\Repository\Values\Content\Language\ALL
const ALL
Constant for use in API's to specify that you want to load all languages.
Definition: API/Repository/Values/Content/Language.php:24
eZ\Publish\API\Repository\Values\Content\LocationCreateStruct
This class is used to create a new Location for a content object.
Definition: API/Repository/Values/Content/LocationCreateStruct.php:15
eZ\Publish\API\Repository\Values\Content\RelationList
List of relations.
Definition: API/Repository/Values/Content/RelationList.php:20
eZ\Publish\API\Repository\Values\Content\VersionInfo
Definition: API/Repository/Values/Content/VersionInfo.php:27
eZ\Publish\API\Repository\Values\User\User
Definition: Publish/API/Repository/Values/User/User.php:24
eZ\Publish\API\Repository\ContentService
Definition: API/Repository/ContentService.php:27
eZ\Publish\API\Repository\ContentService\loadContentByContentInfo
loadContentByContentInfo(ContentInfo $contentInfo, array $languages=null, $versionNo=null, $useAlwaysAvailable=true)
Loads content in a version for the given content info object.
eZ\Publish\API\Repository\ContentService\loadContentInfoList
loadContentInfoList(array $contentIds)
Bulk-load ContentInfo items by id's.
eZ\Publish\API\Repository\ContentService\deleteContent
deleteContent(ContentInfo $contentInfo)
Deletes a content object including all its versions and locations including their subtrees.
eZ\Publish\API\Repository\ContentService\deleteTranslationFromDraft
deleteTranslationFromDraft(VersionInfo $versionInfo, $languageCode)
Delete specified Translation from a Content Draft.
eZ\Publish\API\Repository\ContentService\loadRelations
loadRelations(VersionInfo $versionInfo)
Loads all outgoing relations for the given version.
eZ\Publish\API\Repository\ContentService\loadContentInfoByRemoteId
loadContentInfoByRemoteId($remoteId)
Loads a content info object for the given remoteId.
eZ\Publish\API\Repository\ContentService\loadVersionInfoById
loadVersionInfoById($contentId, $versionNo=null)
Loads a version info of the given content object id.
eZ\Publish\API\Repository\ContentService\loadVersionInfo
loadVersionInfo(ContentInfo $contentInfo, $versionNo=null)
Loads a version info of the given content object.
eZ\Publish\API\Repository\ContentService\newContentUpdateStruct
newContentUpdateStruct()
Instantiates a new content update struct.
eZ\Publish\API\Repository\ContentService\publishVersion
publishVersion(VersionInfo $versionInfo, array $translations=Language::ALL)
Publishes a content version.
eZ\Publish\API\Repository\ContentService\loadVersions
loadVersions(ContentInfo $contentInfo, ?int $status=null)
Loads all versions for the given content.
eZ\Publish\API\Repository\ContentService\createContentDraft
createContentDraft(ContentInfo $contentInfo, VersionInfo $versionInfo=null, User $creator=null, ?Language $language=null)
Creates a draft from a published or archived version.
eZ\Publish\API\Repository\ContentService\updateContentMetadata
updateContentMetadata(ContentInfo $contentInfo, ContentMetadataUpdateStruct $contentMetadataUpdateStruct)
Updates the metadata.
eZ\Publish\API\Repository\ContentService\updateContent
updateContent(VersionInfo $versionInfo, ContentUpdateStruct $contentUpdateStruct)
Updates the fields of a draft.
eZ\Publish\API\Repository\ContentService\loadContentDrafts
loadContentDrafts(User $user=null)
Loads drafts for a user.
eZ\Publish\API\Repository\ContentService\loadContent
loadContent($contentId, array $languages=null, $versionNo=null, $useAlwaysAvailable=true)
Loads content in a version of the given content object.
eZ\Publish\API\Repository\ContentService\revealContent
revealContent(ContentInfo $contentInfo)
Reveals Content hidden by hideContent API.
eZ\Publish\API\Repository\ContentService\copyContent
copyContent(ContentInfo $contentInfo, LocationCreateStruct $destinationLocationCreateStruct, VersionInfo $versionInfo=null)
Copies the content to a new location.
eZ\Publish\API\Repository\ContentService\deleteTranslation
deleteTranslation(ContentInfo $contentInfo, $languageCode)
Delete Content item Translation from all Versions (including archived ones) of a Content Object.
eZ\Publish\API\Repository\ContentService\countContentDrafts
countContentDrafts(?User $user=null)
Counts drafts for a user.
eZ\Publish\API\Repository\ContentService\loadReverseRelationList
loadReverseRelationList(ContentInfo $contentInfo, int $offset=0, int $limit=-1)
Loads all incoming relations for a content object.
eZ\Publish\API\Repository\ContentService\addRelation
addRelation(VersionInfo $sourceVersion, ContentInfo $destinationContent)
Adds a relation of type common.
eZ\Publish\API\Repository\ContentService\loadContentByRemoteId
loadContentByRemoteId($remoteId, array $languages=null, $versionNo=null, $useAlwaysAvailable=true)
Loads content in a version for the content object reference by the given remote id.
eZ\Publish\API\Repository\ContentService\loadReverseRelations
loadReverseRelations(ContentInfo $contentInfo)
Loads all incoming relations for a content object.
eZ\Publish\API\Repository\ContentService\removeTranslation
removeTranslation(ContentInfo $contentInfo, $languageCode)
Remove Content Object translation from all Versions (including archived ones) of a Content Object.
eZ\Publish\API\Repository\ContentService\countReverseRelations
countReverseRelations(ContentInfo $contentInfo)
Counts all incoming relations for the given content object.
eZ\Publish\API\Repository\ContentService\deleteVersion
deleteVersion(VersionInfo $versionInfo)
Removes the given version.
eZ\Publish\API\Repository\ContentService\loadContentByVersionInfo
loadContentByVersionInfo(VersionInfo $versionInfo, array $languages=null, $useAlwaysAvailable=true)
Loads content in the version given by version info.
eZ\Publish\API\Repository\ContentService\createContent
createContent(ContentCreateStruct $contentCreateStruct, array $locationCreateStructs=[])
Creates a new content draft assigned to the authenticated user.
eZ\Publish\API\Repository\ContentService\newContentMetadataUpdateStruct
newContentMetadataUpdateStruct()
Instantiates a new content meta data update struct.
eZ\Publish\API\Repository\ContentService\hideContent
hideContent(ContentInfo $contentInfo)
Hides Content by making all the Locations appear hidden.
eZ\Publish\API\Repository\ContentService\loadContentDraftList
loadContentDraftList(?User $user=null, int $offset=0, int $limit=-1)
Loads drafts for a user when content is not in the trash.
eZ\Publish\API\Repository\ContentService\loadContentListByContentInfo
loadContentListByContentInfo(array $contentInfoList, array $languages=[], $useAlwaysAvailable=true)
Bulk-load Content items by the list of ContentInfo Value Objects.
eZ\Publish\API\Repository\ContentService\loadContentInfo
loadContentInfo($contentId)
Loads a content info object.
eZ\Publish\API\Repository\ContentService\deleteRelation
deleteRelation(VersionInfo $sourceVersion, ContentInfo $destinationContent)
Removes a relation of type COMMON from a draft.
eZ\Publish\API\Repository\ContentService\newContentCreateStruct
newContentCreateStruct(ContentType $contentType, $mainLanguageCode)
Instantiates a new content create struct object.
eZ\Publish\API\Repository
Definition: API/Repository/BookmarkService.php:9
eZ\Publish\SPI\Persistence\Content\Type
Definition: SPI/Persistence/Content/Type/CreateStruct.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.