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

ContentHandler.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Persistence\Cache;
8
9 use eZ\Publish\API\Repository\Values\Content\Relation as APIRelation;
10 use eZ\Publish\SPI\Persistence\Content;
11 use eZ\Publish\SPI\Persistence\Content\ContentInfo;
12 use eZ\Publish\SPI\Persistence\Content\CreateStruct;
13 use eZ\Publish\SPI\Persistence\Content\Handler as ContentHandlerInterface;
14 use eZ\Publish\SPI\Persistence\Content\MetadataUpdateStruct;
15 use eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct as RelationCreateStruct;
16 use eZ\Publish\SPI\Persistence\Content\UpdateStruct;
17 use eZ\Publish\SPI\Persistence\Content\VersionInfo;
18
22 class ContentHandler extends AbstractInMemoryPersistenceHandler implements ContentHandlerInterface
23 {
24 private const CONTENT_IDENTIFIER = 'content';
25 private const LOCATION_IDENTIFIER = 'location';
26 private const LOCATION_PATH_IDENTIFIER = 'location_path';
27 private const CONTENT_INFO_IDENTIFIER = 'content_info';
28 private const CONTENT_INFO_BY_REMOTE_ID_IDENTIFIER = 'content_info_by_remote_id';
29 private const CONTENT_FIELDS_TYPE_IDENTIFIER = 'content_fields_type';
30 private const CONTENT_VERSION_LIST_IDENTIFIER = 'content_version_list';
31 private const CONTENT_VERSION_INFO_IDENTIFIER = 'content_version_info';
32 private const CONTENT_VERSION_IDENTIFIER = 'content_version';
33
34 public const ALL_TRANSLATIONS_KEY = '0';
35
37 private $getContentInfoTags;
38
40 private $getContentInfoKeys;
41
43 private $getContentTags;
44
45 protected function init(): void
46 {
47 $this->getContentInfoTags = function (ContentInfo $info, array $tags = []) {
48 $tags[] = $this->cacheIdentifierGenerator->generateTag(self::CONTENT_IDENTIFIER, [$info->id]);
49
50 if ($info->mainLocationId) {
51 $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent($info->id);
52 foreach ($locations as $location) {
53 $tags[] = $this->cacheIdentifierGenerator->generateTag(self::LOCATION_IDENTIFIER, [$location->id]);
54 $pathIds = $this->locationPathConverter->convertToPathIds($location->pathString);
55 foreach ($pathIds as $pathId) {
56 $tags[] = $this->cacheIdentifierGenerator->generateTag(self::LOCATION_PATH_IDENTIFIER, [$pathId]);
57 }
58 }
59 }
60
61 return $tags;
62 };
63 $this->getContentInfoKeys = function (ContentInfo $info) {
64 return [
65 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_INFO_IDENTIFIER, [$info->id], true),
66 $this->cacheIdentifierGenerator->generateKey(
67 self::CONTENT_INFO_BY_REMOTE_ID_IDENTIFIER,
68 [$this->cacheIdentifierSanitizer->escapeForCacheKey($info->remoteId)],
69 true
70 ),
71 ];
72 };
73
74 $this->getContentTags = function (Content $content) {
75 $versionInfo = $content->versionInfo;
76 $tags = [
77 $this->cacheIdentifierGenerator->generateTag(
78 self::CONTENT_FIELDS_TYPE_IDENTIFIER,
79 [$versionInfo->contentInfo->contentTypeId]
80 ),
81 ];
82
83 return $this->getCacheTagsForVersion($versionInfo, $tags);
84 };
85 }
86
90 public function create(CreateStruct $struct)
91 {
92 // Cached on demand when published or loaded
93 $this->logger->logCall(__METHOD__, ['struct' => $struct]);
94
95 return $this->persistenceHandler->contentHandler()->create($struct);
96 }
97
101 public function createDraftFromVersion($contentId, $srcVersion, $userId, ?string $languageCode = null)
102 {
103 $this->logger->logCall(__METHOD__, ['content' => $contentId, 'version' => $srcVersion, 'user' => $userId]);
104 $draft = $this->persistenceHandler->contentHandler()->createDraftFromVersion($contentId, $srcVersion, $userId, $languageCode);
105 $this->cache->deleteItems([
106 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_VERSION_LIST_IDENTIFIER, [$contentId], true),
107 ]);
108
109 return $draft;
110 }
111
115 public function copy($contentId, $versionNo = null, $newOwnerId = null)
116 {
117 $this->logger->logCall(__METHOD__, [
118 'content' => $contentId,
119 'version' => $versionNo,
120 'newOwner' => $newOwnerId,
121 ]);
122
123 return $this->persistenceHandler->contentHandler()->copy($contentId, $versionNo, $newOwnerId);
124 }
125
129 public function load($contentId, $versionNo = null, array $translations = null)
130 {
131 $keySuffix = $versionNo ? "-${versionNo}-" : '-';
132 $keySuffix .= empty($translations) ? self::ALL_TRANSLATIONS_KEY : implode('|', $translations);
133
134 return $this->getCacheValue(
135 (int) $contentId,
136 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_IDENTIFIER, [], true) . '-',
137 function ($id) use ($versionNo, $translations) {
138 return $this->persistenceHandler->contentHandler()->load($id, $versionNo, $translations);
139 },
140 $this->getContentTags,
141 function (Content $content) use ($keySuffix) {
142 // Version number & translations is part of keySuffix here and depends on what user asked for
143 return [
144 $this->cacheIdentifierGenerator->generateKey(
145 self::CONTENT_IDENTIFIER,
146 [$content->versionInfo->contentInfo->id],
147 true
148 ) . $keySuffix,
149 ];
150 },
151 $keySuffix,
152 ['content' => $contentId, 'version' => $versionNo, 'translations' => $translations]
153 );
154 }
155
156 public function loadContentList(array $contentIds, array $translations = null): array
157 {
158 $keySuffix = '-' . (empty($translations) ? self::ALL_TRANSLATIONS_KEY : implode('|', $translations));
159
160 return $this->getMultipleCacheValues(
161 $contentIds,
162 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_IDENTIFIER, [], true) . '-',
163 function (array $cacheMissIds) use ($translations) {
164 return $this->persistenceHandler->contentHandler()->loadContentList($cacheMissIds, $translations);
165 },
166 $this->getContentTags,
167 function (Content $content) use ($keySuffix) {
168 // Translations is part of keySuffix here and depends on what user asked for
169 return [
170 $this->cacheIdentifierGenerator->generateKey(
171 self::CONTENT_IDENTIFIER,
172 [$content->versionInfo->contentInfo->id],
173 true
174 ) . $keySuffix,
175 ];
176 },
177 $keySuffix,
178 ['content' => $contentIds, 'translations' => $translations]
179 );
180 }
181
185 public function loadContentInfo($contentId)
186 {
187 return $this->getCacheValue(
188 $contentId,
189 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_INFO_IDENTIFIER, [], true) . '-',
190 function ($contentId) {
191 return $this->persistenceHandler->contentHandler()->loadContentInfo($contentId);
192 },
193 $this->getContentInfoTags,
194 $this->getContentInfoKeys,
195 '',
196 ['content' => $contentId]
197 );
198 }
199
200 public function loadContentInfoList(array $contentIds)
201 {
202 return $this->getMultipleCacheValues(
203 $contentIds,
204 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_INFO_IDENTIFIER, [], true) . '-',
205 function (array $cacheMissIds) {
206 return $this->persistenceHandler->contentHandler()->loadContentInfoList($cacheMissIds);
207 },
208 $this->getContentInfoTags,
209 $this->getContentInfoKeys,
210 '',
211 ['content' => $contentIds]
212 );
213 }
214
218 public function loadContentInfoByRemoteId($remoteId)
219 {
220 return $this->getCacheValue(
221 $this->cacheIdentifierSanitizer->escapeForCacheKey($remoteId),
222 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_INFO_BY_REMOTE_ID_IDENTIFIER, [], true) . '-',
223 function () use ($remoteId) {
224 return $this->persistenceHandler->contentHandler()->loadContentInfoByRemoteId($remoteId);
225 },
226 $this->getContentInfoTags,
227 $this->getContentInfoKeys,
228 '',
229 ['content' => $remoteId]
230 );
231 }
232
236 public function loadVersionInfo($contentId, $versionNo = null)
237 {
238 $keySuffix = $versionNo ? "-${versionNo}" : '';
239 $cacheItem = $this->cache->getItem(
240 $this->cacheIdentifierGenerator->generateKey(
241 self::CONTENT_VERSION_INFO_IDENTIFIER,
242 [$contentId],
243 true
244 ) . $keySuffix
245 );
246
247 if ($cacheItem->isHit()) {
248 $this->logger->logCacheHit(['content' => $contentId, 'version' => $versionNo]);
249
250 return $cacheItem->get();
251 }
252
253 $this->logger->logCacheMiss(['content' => $contentId, 'version' => $versionNo]);
254 $versionInfo = $this->persistenceHandler->contentHandler()->loadVersionInfo($contentId, $versionNo);
255 $cacheItem->set($versionInfo);
256 $cacheItem->tag($this->getCacheTagsForVersion($versionInfo));
257 $this->cache->save($cacheItem);
258
259 return $versionInfo;
260 }
261
265 public function countDraftsForUser(int $userId): int
266 {
267 $this->logger->logCall(__METHOD__, ['user' => $userId]);
268
269 return $this->persistenceHandler->contentHandler()->countDraftsForUser($userId);
270 }
271
275 public function loadDraftsForUser($userId)
276 {
277 $this->logger->logCall(__METHOD__, ['user' => $userId]);
278
279 return $this->persistenceHandler->contentHandler()->loadDraftsForUser($userId);
280 }
281
285 public function loadDraftListForUser(int $userId, int $offset = 0, int $limit = -1): array
286 {
287 $this->logger->logCall(__METHOD__, ['user' => $userId, 'offset' => $offset, 'limit' => $limit]);
288
289 return $this->persistenceHandler->contentHandler()->loadDraftListForUser($userId, $offset, $limit);
290 }
291
295 public function setStatus($contentId, $status, $versionNo)
296 {
297 $this->logger->logCall(__METHOD__, ['content' => $contentId, 'status' => $status, 'version' => $versionNo]);
298 $return = $this->persistenceHandler->contentHandler()->setStatus($contentId, $status, $versionNo);
299
300 if ($status === VersionInfo::STATUS_PUBLISHED) {
301 $this->cache->invalidateTags([
302 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_IDENTIFIER, [$contentId]),
303 ]);
304 } else {
305 $this->cache->invalidateTags([
306 $this->cacheIdentifierGenerator->generateTag(
307 self::CONTENT_VERSION_IDENTIFIER,
308 [$contentId, $versionNo]
309 ),
310 ]);
311 }
312
313 return $return;
314 }
315
319 public function updateMetadata($contentId, MetadataUpdateStruct $struct)
320 {
321 $this->logger->logCall(__METHOD__, ['content' => $contentId, 'struct' => $struct]);
322 $contentInfo = $this->persistenceHandler->contentHandler()->updateMetadata($contentId, $struct);
323 $this->cache->invalidateTags([
324 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_IDENTIFIER, [$contentId]),
325 ]);
326
327 return $contentInfo;
328 }
329
333 public function updateContent($contentId, $versionNo, UpdateStruct $struct)
334 {
335 $this->logger->logCall(__METHOD__, ['content' => $contentId, 'version' => $versionNo, 'struct' => $struct]);
336 $content = $this->persistenceHandler->contentHandler()->updateContent($contentId, $versionNo, $struct);
337
338 $this->cache->invalidateTags([
339 $this->cacheIdentifierGenerator->generateTag(
340 self::CONTENT_VERSION_IDENTIFIER,
341 [$contentId, $versionNo]
342 ),
343 ]);
344
345 return $content;
346 }
347
351 public function deleteContent($contentId)
352 {
353 $this->logger->logCall(__METHOD__, ['content' => $contentId]);
354
355 // Load reverse field relations first
356 $reverseRelations = $this->persistenceHandler->contentHandler()->loadReverseRelations(
357 $contentId,
358 APIRelation::FIELD | APIRelation::ASSET
359 );
360
361 $return = $this->persistenceHandler->contentHandler()->deleteContent($contentId);
362
363 if (!empty($reverseRelations)) {
364 $tags = \array_map(
365 function ($relation) {
366 // only the full content object *with* fields is affected by this
367 return $this->cacheIdentifierGenerator->generateTag(self::CONTENT_IDENTIFIER, [$relation->sourceContentId]);
368 },
369 $reverseRelations
370 );
371 } else {
372 $tags = [];
373 }
374 $tags[] = $this->cacheIdentifierGenerator->generateTag(self::CONTENT_IDENTIFIER, [$contentId]);
375 $this->cache->invalidateTags($tags);
376
377 return $return;
378 }
379
383 public function deleteVersion($contentId, $versionNo)
384 {
385 $this->logger->logCall(__METHOD__, ['content' => $contentId, 'version' => $versionNo]);
386 $return = $this->persistenceHandler->contentHandler()->deleteVersion($contentId, $versionNo);
387
388 $this->cache->invalidateTags([
389 $this->cacheIdentifierGenerator->generateTag(
390 self::CONTENT_VERSION_IDENTIFIER,
391 [$contentId, $versionNo]
392 ),
393 ]);
394
395 return $return;
396 }
397
401 public function listVersions($contentId, $status = null, $limit = -1)
402 {
403 // Don't cache non typical lookups to avoid filling up cache and tags.
404 if ($status !== null || $limit !== -1) {
405 $this->logger->logCall(__METHOD__, ['content' => $contentId, 'status' => $status]);
406
407 return $this->persistenceHandler->contentHandler()->listVersions($contentId, $status, $limit);
408 }
409
410 // Cache default lookups
411 $cacheItem = $this->cache->getItem(
412 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_VERSION_LIST_IDENTIFIER, [$contentId], true)
413 );
414
415 if ($cacheItem->isHit()) {
416 $this->logger->logCacheHit(['content' => $contentId]);
417
418 return $cacheItem->get();
419 }
420
421 $this->logger->logCacheMiss(['content' => $contentId]);
422 $versions = $this->persistenceHandler->contentHandler()->listVersions($contentId, $status, $limit);
423 $cacheItem->set($versions);
424 $tags = [
425 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_IDENTIFIER, [$contentId]),
426 ];
427
428 foreach ($versions as $version) {
429 $tags = $this->getCacheTagsForVersion($version, $tags);
430 }
431 $cacheItem->tag($tags);
432 $this->cache->save($cacheItem);
433
434 return $versions;
435 }
436
440 public function addRelation(RelationCreateStruct $relation)
441 {
442 $this->logger->logCall(__METHOD__, ['struct' => $relation]);
443
444 return $this->persistenceHandler->contentHandler()->addRelation($relation);
445 }
446
450 public function removeRelation($relationId, $type)
451 {
452 $this->logger->logCall(__METHOD__, ['relation' => $relationId, 'type' => $type]);
453 $this->persistenceHandler->contentHandler()->removeRelation($relationId, $type);
454 }
455
459 public function loadRelations($sourceContentId, $sourceContentVersionNo = null, $type = null)
460 {
461 $this->logger->logCall(
462 __METHOD__,
463 [
464 'content' => $sourceContentId,
465 'version' => $sourceContentVersionNo,
466 'type' => $type,
467 ]
468 );
469
470 return $this->persistenceHandler->contentHandler()->loadRelations($sourceContentId, $sourceContentVersionNo, $type);
471 }
472
476 public function countReverseRelations(int $destinationContentId, ?int $type = null): int
477 {
478 $this->logger->logCall(__METHOD__, ['content' => $destinationContentId, 'type' => $type]);
479
480 return $this->persistenceHandler->contentHandler()->countReverseRelations($destinationContentId, $type);
481 }
482
486 public function loadReverseRelations($destinationContentId, $type = null)
487 {
488 $this->logger->logCall(__METHOD__, ['content' => $destinationContentId, 'type' => $type]);
489
490 return $this->persistenceHandler->contentHandler()->loadReverseRelations($destinationContentId, $type);
491 }
492
496 public function loadReverseRelationList(
497 int $destinationContentId,
498 int $offset = 0,
499 int $limit = -1,
500 ?int $type = null
501 ): array {
502 $this->logger->logCall(__METHOD__, [
503 'content' => $destinationContentId,
504 'offset' => $offset,
505 'limit' => $limit,
506 'type' => $type,
507 ]);
508
509 return $this->persistenceHandler->contentHandler()->loadReverseRelationList(
510 $destinationContentId,
511 $offset,
512 $limit,
513 $type
514 );
515 }
516
520 public function publish($contentId, $versionNo, MetadataUpdateStruct $struct)
521 {
522 $this->logger->logCall(__METHOD__, ['content' => $contentId, 'version' => $versionNo, 'struct' => $struct]);
523 $content = $this->persistenceHandler->contentHandler()->publish($contentId, $versionNo, $struct);
524 $this->cache->invalidateTags([
525 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_IDENTIFIER, [$contentId]),
526 ]);
527
528 return $content;
529 }
530
534 public function removeTranslationFromContent($contentId, $languageCode)
535 {
536 $this->deleteTranslationFromContent($contentId, $languageCode);
537 }
538
542 public function deleteTranslationFromContent($contentId, $languageCode)
543 {
544 $this->logger->logCall(
545 __METHOD__,
546 [
547 'contentId' => $contentId,
548 'languageCode' => $languageCode,
549 ]
550 );
551
552 $this->persistenceHandler->contentHandler()->deleteTranslationFromContent($contentId, $languageCode);
553 $this->cache->invalidateTags([
554 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_IDENTIFIER, [$contentId]),
555 ]);
556 }
557
561 public function deleteTranslationFromDraft($contentId, $versionNo, $languageCode)
562 {
563 $this->logger->logCall(
564 __METHOD__,
565 ['content' => $contentId, 'version' => $versionNo, 'languageCode' => $languageCode]
566 );
567 $content = $this->persistenceHandler->contentHandler()->deleteTranslationFromDraft(
568 $contentId,
569 $versionNo,
570 $languageCode
571 );
572
573 $this->cache->invalidateTags([
574 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_VERSION_IDENTIFIER, [$contentId, $versionNo]),
575 ]);
576
577 return $content;
578 }
579
587 private function getCacheTagsForVersion(VersionInfo $versionInfo, array $tags = []): array
588 {
589 $contentInfo = $versionInfo->contentInfo;
590 $tags[] = $this->cacheIdentifierGenerator->generateTag(
591 self::CONTENT_VERSION_IDENTIFIER,
592 [$contentInfo->id, $versionInfo->versionNo]
593 );
594
595 $getContentInfoTagsFn = $this->getContentInfoTags;
596
597 return $getContentInfoTagsFn($contentInfo, $tags);
598 }
599 }
eZ\Publish\API\Repository\Values\Content\Relation
Definition: API/Repository/Values/Content/Relation.php:21
eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler\getMultipleCacheValues
getMultipleCacheValues(array $ids, string $keyPrefix, callable $backendLoader, callable $cacheTagger, callable $cacheIndexes, string $keySuffix='', array $arguments=[])
Load several cache items from cache and loggs the hits / misses.
Definition: AbstractInMemoryHandler.php:195
eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler\getCacheValue
getCacheValue( $id, string $keyPrefix, callable $backendLoader, callable $cacheTagger, callable $cacheIndexes, string $keySuffix='', array $arguments=[])
Load one cache item from cache and loggs the hits / misses.
Definition: AbstractInMemoryHandler.php:71
eZ\Publish\Core\Persistence\Cache\AbstractInMemoryPersistenceHandler
Internal abstract handler for use in other SPI Persistence Cache Handlers.
Definition: AbstractInMemoryPersistenceHandler.php:22
eZ\Publish\Core\Persistence\Cache\ContentHandler
Definition: ContentHandler.php:23
eZ\Publish\Core\Persistence\Cache\ContentHandler\updateContent
updateContent($contentId, $versionNo, UpdateStruct $struct)
{}
Definition: ContentHandler.php:333
eZ\Publish\Core\Persistence\Cache\ContentHandler\loadReverseRelationList
loadReverseRelationList(int $destinationContentId, int $offset=0, int $limit=-1, ?int $type=null)
{Loads paginated relations from $contentId.Optionally, loads only those with $type....
Definition: ContentHandler.php:496
eZ\Publish\Core\Persistence\Cache\ContentHandler\CONTENT_INFO_IDENTIFIER
const CONTENT_INFO_IDENTIFIER
Definition: ContentHandler.php:27
eZ\Publish\Core\Persistence\Cache\ContentHandler\loadContentInfoByRemoteId
loadContentInfoByRemoteId($remoteId)
{Returns the metadata object for a content identified by $remoteId.\eZ\Publish\SPI\Persistence\Conten...
Definition: ContentHandler.php:218
eZ\Publish\Core\Persistence\Cache\ContentHandler\createDraftFromVersion
createDraftFromVersion($contentId, $srcVersion, $userId, ?string $languageCode=null)
{Creates a new draft version from $contentId in $srcVersion number.Copies all fields from $contentId ...
Definition: ContentHandler.php:101
eZ\Publish\Core\Persistence\Cache\ContentHandler\loadVersionInfo
loadVersionInfo($contentId, $versionNo=null)
{Returns the version object for a content/version identified by $contentId and $versionNo....
Definition: ContentHandler.php:236
eZ\Publish\Core\Persistence\Cache\ContentHandler\updateMetadata
updateMetadata($contentId, MetadataUpdateStruct $struct)
{Updates a content object meta data, identified by $contentId.\eZ\Publish\SPI\Persistence\Content\Con...
Definition: ContentHandler.php:319
eZ\Publish\Core\Persistence\Cache\ContentHandler\addRelation
addRelation(RelationCreateStruct $relation)
{Creates a relation between $sourceContentId in $sourceContentVersionNo and $destinationContentId wit...
Definition: ContentHandler.php:440
eZ\Publish\Core\Persistence\Cache\ContentHandler\CONTENT_FIELDS_TYPE_IDENTIFIER
const CONTENT_FIELDS_TYPE_IDENTIFIER
Definition: ContentHandler.php:29
eZ\Publish\Core\Persistence\Cache\ContentHandler\countReverseRelations
countReverseRelations(int $destinationContentId, ?int $type=null)
{Counts relations from $destinationContentId only against published versions.Optionally,...
Definition: ContentHandler.php:476
eZ\Publish\Core\Persistence\Cache\ContentHandler\$getContentInfoTags
$getContentInfoTags
Definition: ContentHandler.php:37
eZ\Publish\Core\Persistence\Cache\ContentHandler\CONTENT_INFO_BY_REMOTE_ID_IDENTIFIER
const CONTENT_INFO_BY_REMOTE_ID_IDENTIFIER
Definition: ContentHandler.php:28
eZ\Publish\Core\Persistence\Cache\ContentHandler\create
create(CreateStruct $struct)
{}
Definition: ContentHandler.php:90
eZ\Publish\Core\Persistence\Cache\ContentHandler\removeTranslationFromContent
removeTranslationFromContent($contentId, $languageCode)
{Remove the specified translation from all the Versions of a Content Object.since 6....
Definition: ContentHandler.php:534
eZ\Publish\Core\Persistence\Cache\ContentHandler\deleteTranslationFromDraft
deleteTranslationFromDraft($contentId, $versionNo, $languageCode)
{Remove the specified Translation from the given Version Draft of a Content Object....
Definition: ContentHandler.php:561
eZ\Publish\Core\Persistence\Cache\ContentHandler\removeRelation
removeRelation($relationId, $type)
{Removes a relation by relation Id.Should the existence verifications happen here or is this supposed...
Definition: ContentHandler.php:450
eZ\Publish\Core\Persistence\Cache\ContentHandler\ALL_TRANSLATIONS_KEY
const ALL_TRANSLATIONS_KEY
Definition: ContentHandler.php:34
eZ\Publish\Core\Persistence\Cache\ContentHandler\$getContentInfoKeys
$getContentInfoKeys
Definition: ContentHandler.php:40
eZ\Publish\Core\Persistence\Cache\ContentHandler\loadRelations
loadRelations($sourceContentId, $sourceContentVersionNo=null, $type=null)
{Loads relations from $sourceContentId.Optionally, loads only those with $type and $sourceContentVers...
Definition: ContentHandler.php:459
eZ\Publish\Core\Persistence\Cache\ContentHandler\$getContentTags
$getContentTags
Definition: ContentHandler.php:43
eZ\Publish\Core\Persistence\Cache\ContentHandler\LOCATION_IDENTIFIER
const LOCATION_IDENTIFIER
Definition: ContentHandler.php:25
eZ\Publish\Core\Persistence\Cache\ContentHandler\loadContentInfo
loadContentInfo($contentId)
{Returns the metadata object for a content identified by $contentId.\eZ\Publish\SPI\Persistence\Conte...
Definition: ContentHandler.php:185
eZ\Publish\Core\Persistence\Cache\ContentHandler\CONTENT_VERSION_IDENTIFIER
const CONTENT_VERSION_IDENTIFIER
Definition: ContentHandler.php:32
eZ\Publish\Core\Persistence\Cache\ContentHandler\deleteVersion
deleteVersion($contentId, $versionNo)
{Deletes given version, its fields, node assignment, relations and names.Removes the relations,...
Definition: ContentHandler.php:383
eZ\Publish\Core\Persistence\Cache\ContentHandler\listVersions
listVersions($contentId, $status=null, $limit=-1)
{Returns the versions for $contentId.Result is returned with oldest version first (sorted by created,...
Definition: ContentHandler.php:401
eZ\Publish\Core\Persistence\Cache\ContentHandler\loadContentInfoList
loadContentInfoList(array $contentIds)
Return list of unique Content Info, with content id as key.
Definition: ContentHandler.php:200
eZ\Publish\Core\Persistence\Cache\ContentHandler\CONTENT_VERSION_INFO_IDENTIFIER
const CONTENT_VERSION_INFO_IDENTIFIER
Definition: ContentHandler.php:31
eZ\Publish\Core\Persistence\Cache\ContentHandler\getCacheTagsForVersion
getCacheTagsForVersion(VersionInfo $versionInfo, array $tags=[])
Return relevant content and location tags so cache can be purged reliably.
Definition: ContentHandler.php:587
eZ\Publish\Core\Persistence\Cache\ContentHandler\countDraftsForUser
countDraftsForUser(int $userId)
{Returns the number of versions with draft status created by the given $userId.int}
Definition: ContentHandler.php:265
eZ\Publish\Core\Persistence\Cache\ContentHandler\publish
publish($contentId, $versionNo, MetadataUpdateStruct $struct)
{Performs the publishing operations required to set the version identified by $updateStruct->versionN...
Definition: ContentHandler.php:520
eZ\Publish\Core\Persistence\Cache\ContentHandler\loadDraftListForUser
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....
Definition: ContentHandler.php:285
eZ\Publish\Core\Persistence\Cache\ContentHandler\loadDraftsForUser
loadDraftsForUser($userId)
{Returns all versions with draft status created by the given $userId.\eZ\Publish\SPI\Persistence\Cont...
Definition: ContentHandler.php:275
eZ\Publish\Core\Persistence\Cache\ContentHandler\deleteTranslationFromContent
deleteTranslationFromContent($contentId, $languageCode)
{Delete the specified translation from all the Versions of a Content Object.language code of the tran...
Definition: ContentHandler.php:542
eZ\Publish\Core\Persistence\Cache\ContentHandler\init
init()
Optional function to initialize handler without having to overload __construct().
Definition: ContentHandler.php:45
eZ\Publish\Core\Persistence\Cache\ContentHandler\CONTENT_VERSION_LIST_IDENTIFIER
const CONTENT_VERSION_LIST_IDENTIFIER
Definition: ContentHandler.php:30
eZ\Publish\Core\Persistence\Cache\ContentHandler\loadContentList
loadContentList(array $contentIds, array $translations=null)
Return list of unique Content, with content id as key.
Definition: ContentHandler.php:156
eZ\Publish\Core\Persistence\Cache\ContentHandler\CONTENT_IDENTIFIER
const CONTENT_IDENTIFIER
Definition: ContentHandler.php:24
eZ\Publish\Core\Persistence\Cache\ContentHandler\copy
copy($contentId, $versionNo=null, $newOwnerId=null)
{Copy Content with Fields, Versions & Relations from $contentId in $version.Copies all fields and rel...
Definition: ContentHandler.php:115
eZ\Publish\Core\Persistence\Cache\ContentHandler\loadReverseRelations
loadReverseRelations($destinationContentId, $type=null)
{Loads relations from $contentId.Optionally, loads only those with $type.Only loads relations against...
Definition: ContentHandler.php:486
eZ\Publish\Core\Persistence\Cache\ContentHandler\deleteContent
deleteContent($contentId)
{Deletes all versions and fields, all locations (subtree), and all relations.Removes the relations,...
Definition: ContentHandler.php:351
eZ\Publish\Core\Persistence\Cache\ContentHandler\setStatus
setStatus($contentId, $status, $versionNo)
{Sets the status of object identified by $contentId and $version to $status.The $status can be one of...
Definition: ContentHandler.php:295
eZ\Publish\Core\Persistence\Cache\ContentHandler\LOCATION_PATH_IDENTIFIER
const LOCATION_PATH_IDENTIFIER
Definition: ContentHandler.php:26
eZ\Publish\Core\Persistence\Cache\ContentHandler\load
load($contentId, $versionNo=null, array $translations=null)
{Returns the raw data of a content object identified by $id, in a struct.If you want to load current ...
Definition: ContentHandler.php:129
eZ\Publish\SPI\Persistence\Bookmark\CreateStruct
Definition: SPI/Persistence/Bookmark/CreateStruct.php:14
eZ\Publish\SPI\Persistence\Content\ContentInfo
This class provides all version independent information of the content object.
Definition: SPI/Persistence/Content/ContentInfo.php:17
eZ\Publish\SPI\Persistence\Content\CreateStruct
Definition: SPI/Persistence/Content/CreateStruct.php:12
eZ\Publish\SPI\Persistence\Content\Location\UpdateStruct
Definition: Content/Location/UpdateStruct.php:12
eZ\Publish\SPI\Persistence\Content\MetadataUpdateStruct
Definition: MetadataUpdateStruct.php:12
eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct
CreateStruct representing a relation between content.
Definition: SPI/Persistence/Content/Relation/CreateStruct.php:15
eZ\Publish\SPI\Persistence\Content\UpdateStruct
Definition: Content/UpdateStruct.php:12
eZ\Publish\SPI\Persistence\Content\VersionInfo
This class holds version information data.
Definition: SPI/Persistence/Content/VersionInfo.php:15
eZ\Publish\SPI\Persistence\Content\VersionInfo\STATUS_PUBLISHED
const STATUS_PUBLISHED
Definition: SPI/Persistence/Content/VersionInfo.php:22
eZ\Publish\SPI\Persistence\Content
Content value object, bound to a version.
Definition: Publish/SPI/Persistence/Content.php:17
eZ\Publish\SPI\Persistence\Content\Handler
The Content Handler interface defines content operations on the storage engine.
Definition: SPI/Persistence/Content/Handler.php:20
eZ\Publish\Core\Persistence\Cache
Definition: AbstractHandler.php:7
eZ\Publish\SPI\Persistence\Content
Definition: SPI/Persistence/Content/ContentInfo.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.