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

ContentTypeHandler.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Persistence\Cache;
8
9 use eZ\Publish\SPI\Persistence\Content\Type\Handler as ContentTypeHandlerInterface;
10 use eZ\Publish\SPI\Persistence\Content\Type;
11 use eZ\Publish\SPI\Persistence\Content\Type\CreateStruct;
12 use eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct;
13 use eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition;
14 use eZ\Publish\SPI\Persistence\Content\Type\Group\CreateStruct as GroupCreateStruct;
15 use eZ\Publish\SPI\Persistence\Content\Type\Group\UpdateStruct as GroupUpdateStruct;
16
24 class ContentTypeHandler extends AbstractInMemoryPersistenceHandler implements ContentTypeHandlerInterface
25 {
26 private const TYPE_IDENTIFIER = 'type';
27 private const TYPE_GROUP_IDENTIFIER = 'type_group';
28 private const CONTENT_TYPE_IDENTIFIER = 'content_type';
29 private const CONTENT_TYPE_GROUP_IDENTIFIER = 'content_type_group';
30 private const CONTENT_TYPE_GROUP_WITH_ID_SUFFIX_IDENTIFIER = 'content_type_group_with_id_suffix';
31 private const CONTENT_TYPE_GROUP_WITH_BY_REMOTE_SUFFIX_IDENTIFIER = 'content_type_group_with_by_remote_suffix';
32 private const CONTENT_TYPE_GROUP_LIST_IDENTIFIER = 'content_type_group_list';
33 private const BY_IDENTIFIER_SUFFIX = 'by_identifier_suffix';
34 private const CONTENT_TYPE_LIST_BY_GROUP_IDENTIFIER = 'content_type_list_by_group';
35 private const BY_REMOTE_SUFFIX = 'by_remote_suffix';
36 private const TYPE_MAP_IDENTIFIER = 'type_map';
37 private const CONTENT_FIELDS_TYPE_IDENTIFIER = 'content_fields_type';
38 private const TYPE_WITHOUT_VALUE_IDENTIFIER = 'type_without_value';
39 private const CONTENT_TYPE_FIELD_MAP_IDENTIFIER = 'content_type_field_map';
40
42 private $getGroupTags;
43
45 private $getGroupKeys;
46
48 private $getTypeTags;
49
51 private $getTypeKeys;
52
56 protected function init(): void
57 {
58 $this->getGroupTags = function (Type\Group $group) {
59 return [
60 $this->cacheIdentifierGenerator->generateTag(self::TYPE_GROUP_IDENTIFIER, [$group->id]),
61 ];
62 };
63
64 $this->getGroupKeys = function (Type\Group $group) {
65 return [
66 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_IDENTIFIER, [$group->id]),
67 $this->cacheIdentifierGenerator->generateKey(
68 self::CONTENT_TYPE_GROUP_WITH_ID_SUFFIX_IDENTIFIER,
69 [$this->cacheIdentifierSanitizer->escapeForCacheKey($group->identifier)],
70 true
71 ),
72 ];
73 };
74
75 $this->getTypeTags = function (Type $type) {
76 return [
77 $this->cacheIdentifierGenerator->generateTag(self::TYPE_IDENTIFIER), // For use by deleteByUserAndStatus() as it currently lacks return value for affected type ids
78 $this->cacheIdentifierGenerator->generateTag(self::TYPE_IDENTIFIER, [$type->id]),
79 ];
80 };
81 $this->getTypeKeys = function (Type $type, int $status = Type::STATUS_DEFINED) {
82 return [
83 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_IDENTIFIER, [$type->id], true),
84 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_IDENTIFIER, [$type->id], true) . '-' . $status,
85 $this->cacheIdentifierGenerator->generateKey(
86 self::CONTENT_TYPE_GROUP_WITH_ID_SUFFIX_IDENTIFIER,
87 [$this->cacheIdentifierSanitizer->escapeForCacheKey($type->identifier)],
88 true
89 ),
90 $this->cacheIdentifierGenerator->generateKey(
91 self::CONTENT_TYPE_GROUP_WITH_BY_REMOTE_SUFFIX_IDENTIFIER,
92 [$this->cacheIdentifierSanitizer->escapeForCacheKey($type->remoteId)],
93 true
94 ),
95 ];
96 };
97 }
98
102 public function createGroup(GroupCreateStruct $struct)
103 {
104 $this->logger->logCall(__METHOD__, ['struct' => $struct]);
105 $this->cache->deleteItems([
106 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_LIST_IDENTIFIER, [], true),
107 ]);
108
109 return $this->persistenceHandler->contentTypeHandler()->createGroup($struct);
110 }
111
115 public function updateGroup(GroupUpdateStruct $struct)
116 {
117 $this->logger->logCall(__METHOD__, ['struct' => $struct]);
118 $group = $this->persistenceHandler->contentTypeHandler()->updateGroup($struct);
119
120 $this->cache->deleteItems([
121 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_LIST_IDENTIFIER, [], true),
122 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_IDENTIFIER, [$struct->id], true),
123 $this->cacheIdentifierGenerator->generateKey(
124 self::CONTENT_TYPE_GROUP_WITH_ID_SUFFIX_IDENTIFIER,
125 [$this->cacheIdentifierSanitizer->escapeForCacheKey($struct->identifier)],
126 true
127 ),
128 ]);
129
130 return $group;
131 }
132
136 public function deleteGroup($groupId)
137 {
138 $this->logger->logCall(__METHOD__, ['group' => $groupId]);
139 $return = $this->persistenceHandler->contentTypeHandler()->deleteGroup($groupId);
140
141 $this->cache->invalidateTags([
142 $this->cacheIdentifierGenerator->generateTag(self::TYPE_GROUP_IDENTIFIER, [$groupId]),
143 ]);
144
145 return $return;
146 }
147
151 public function loadGroup($groupId)
152 {
153 return $this->getCacheValue(
154 $groupId,
155 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_IDENTIFIER, [], true) . '-',
156 function ($groupId) {
157 return $this->persistenceHandler->contentTypeHandler()->loadGroup($groupId);
158 },
159 $this->getGroupTags,
160 $this->getGroupKeys
161 );
162 }
163
167 public function loadGroups(array $groupIds)
168 {
169 return $this->getMultipleCacheValues(
170 $groupIds,
171 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_IDENTIFIER, [], true) . '-',
172 function (array $groupIds) {
173 return $this->persistenceHandler->contentTypeHandler()->loadGroups($groupIds);
174 },
175 $this->getGroupTags,
176 $this->getGroupKeys
177 );
178 }
179
183 public function loadGroupByIdentifier($identifier)
184 {
185 return $this->getCacheValue(
186 $this->cacheIdentifierSanitizer->escapeForCacheKey($identifier),
187 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_IDENTIFIER, [], true) . '-',
188 function () use ($identifier) {
189 return $this->persistenceHandler->contentTypeHandler()->loadGroupByIdentifier($identifier);
190 },
191 $this->getGroupTags,
192 $this->getGroupKeys,
193 '-' . $this->cacheIdentifierGenerator->generateKey(self::BY_IDENTIFIER_SUFFIX)
194 );
195 }
196
200 public function loadAllGroups()
201 {
202 return $this->getListCacheValue(
203 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_LIST_IDENTIFIER, [], true),
204 function () {
205 return $this->persistenceHandler->contentTypeHandler()->loadAllGroups();
206 },
207 $this->getGroupTags,
208 $this->getGroupKeys
209 );
210 }
211
215 public function loadContentTypes($groupId, $status = Type::STATUS_DEFINED)
216 {
217 if ($status !== Type::STATUS_DEFINED) {
218 $this->logger->logCall(__METHOD__, ['group' => $groupId, 'status' => $status]);
219
220 return $this->persistenceHandler->contentTypeHandler()->loadContentTypes($groupId, $status);
221 }
222
223 return $this->getListCacheValue(
224 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_LIST_BY_GROUP_IDENTIFIER, [$groupId], true),
225 function () use ($groupId, $status) {
226 return $this->persistenceHandler->contentTypeHandler()->loadContentTypes($groupId, $status);
227 },
228 $this->getTypeTags,
229 $this->getTypeKeys,
230 // Add tag in case of empty list
231 function () use ($groupId) {
232 return [
233 $this->cacheIdentifierGenerator->generateTag(self::TYPE_GROUP_IDENTIFIER, [$groupId]),
234 ];
235 },
236 [$groupId]
237 );
238 }
239
240 public function loadContentTypeList(array $contentTypeIds): array
241 {
242 return $this->getMultipleCacheValues(
243 $contentTypeIds,
244 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_IDENTIFIER, [], true) . '-',
245 function (array $contentTypeIds) {
246 return $this->persistenceHandler->contentTypeHandler()->loadContentTypeList($contentTypeIds);
247 },
248 $this->getTypeTags,
249 $this->getTypeKeys
250 );
251 }
252
256 public function load($typeId, $status = Type::STATUS_DEFINED)
257 {
258 if ($status !== Type::STATUS_DEFINED) {
259 $this->logger->logCall(__METHOD__, ['type' => $typeId, 'status' => $status]);
260
261 return $this->persistenceHandler->contentTypeHandler()->load($typeId, $status);
262 }
263
264 $getTypeKeysFn = $this->getTypeKeys;
265
266 return $this->getCacheValue(
267 $typeId,
268 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_IDENTIFIER, [], true) . '-',
269 function ($typeId) use ($status) {
270 return $this->persistenceHandler->contentTypeHandler()->load($typeId, $status);
271 },
272 $this->getTypeTags,
273 static function (Type $type) use ($status, $getTypeKeysFn) {
274 return $getTypeKeysFn($type, $status);
275 }
276 );
277 }
278
282 public function loadByIdentifier($identifier)
283 {
284 return $this->getCacheValue(
285 $this->cacheIdentifierSanitizer->escapeForCacheKey($identifier),
286 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_IDENTIFIER, [], true) . '-',
287 function () use ($identifier) {
288 return $this->persistenceHandler->contentTypeHandler()->loadByIdentifier($identifier);
289 },
290 $this->getTypeTags,
291 $this->getTypeKeys,
292 '-' . $this->cacheIdentifierGenerator->generateKey(self::BY_IDENTIFIER_SUFFIX)
293 );
294 }
295
299 public function loadByRemoteId($remoteId)
300 {
301 return $this->getCacheValue(
302 $this->cacheIdentifierSanitizer->escapeForCacheKey($remoteId),
303 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_IDENTIFIER, [], true) . '-',
304 function () use ($remoteId) {
305 return $this->persistenceHandler->contentTypeHandler()->loadByRemoteId($remoteId);
306 },
307 $this->getTypeTags,
308 $this->getTypeKeys,
309 '-' . $this->cacheIdentifierGenerator->generateKey(self::BY_REMOTE_SUFFIX)
310 );
311 }
312
316 public function create(CreateStruct $struct)
317 {
318 $this->logger->logCall(__METHOD__, ['struct' => $struct]);
319
320 $type = $this->persistenceHandler->contentTypeHandler()->create($struct);
321
322 // Clear loadContentTypes() cache as we effetely add an item to it's collection here.
323 $this->cache->deleteItems(array_map(
324 function ($groupId) {
325 return $this->cacheIdentifierGenerator->generateKey(
326 self::CONTENT_TYPE_LIST_BY_GROUP_IDENTIFIER,
327 [$groupId],
328 true
329 );
330 },
331 $struct->groupIds
332 ));
333
334 return $type;
335 }
336
340 public function update($typeId, $status, UpdateStruct $struct)
341 {
342 $this->logger->logCall(__METHOD__, ['type' => $typeId, 'status' => $status, 'struct' => $struct]);
343 $type = $this->persistenceHandler->contentTypeHandler()->update($typeId, $status, $struct);
344
345 if ($status === Type::STATUS_DEFINED) {
346 $this->cache->invalidateTags([
347 $this->cacheIdentifierGenerator->generateTag(self::TYPE_IDENTIFIER, [$typeId]),
348 $this->cacheIdentifierGenerator->generateTag(self::TYPE_MAP_IDENTIFIER),
349 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_FIELDS_TYPE_IDENTIFIER, [$typeId]),
350 ]);
351 }
352
353 return $type;
354 }
355
359 public function delete($typeId, $status)
360 {
361 $this->logger->logCall(__METHOD__, ['type' => $typeId, 'status' => $status]);
362 $return = $this->persistenceHandler->contentTypeHandler()->delete($typeId, $status);
363
364 if ($status === Type::STATUS_DEFINED) {
365 $this->cache->invalidateTags([
366 $this->cacheIdentifierGenerator->generateTag(self::TYPE_IDENTIFIER, [$typeId]),
367 $this->cacheIdentifierGenerator->generateTag(self::TYPE_MAP_IDENTIFIER),
368 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_FIELDS_TYPE_IDENTIFIER, [$typeId]),
369 ]);
370 }
371
372 return $return;
373 }
374
378 public function createDraft($modifierId, $typeId)
379 {
380 $this->logger->logCall(__METHOD__, ['modifier' => $modifierId, 'type' => $typeId]);
381
382 return $this->persistenceHandler->contentTypeHandler()->createDraft($modifierId, $typeId);
383 }
384
388 public function copy($userId, $typeId, $status)
389 {
390 $this->logger->logCall(__METHOD__, ['user' => $userId, 'type' => $typeId, 'status' => $status]);
391 $copy = $this->persistenceHandler->contentTypeHandler()->copy($userId, $typeId, $status);
392
393 // Clear loadContentTypes() cache as we effetely add an item to it's collection here.
394 $this->cache->deleteItems(array_map(
395 function ($groupId) {
396 return $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_LIST_BY_GROUP_IDENTIFIER, [$groupId], true);
397 },
398 $copy->groupIds
399 ));
400
401 return $copy;
402 }
403
407 public function unlink($groupId, $typeId, $status)
408 {
409 $this->logger->logCall(__METHOD__, ['group' => $groupId, 'type' => $typeId, 'status' => $status]);
410 $return = $this->persistenceHandler->contentTypeHandler()->unlink($groupId, $typeId, $status);
411
412 if ($status === Type::STATUS_DEFINED) {
413 $this->cache->invalidateTags([
414 $this->cacheIdentifierGenerator->generateTag(self::TYPE_IDENTIFIER, [$typeId]),
415 ]);
416 }
417
418 return $return;
419 }
420
424 public function link($groupId, $typeId, $status)
425 {
426 $this->logger->logCall(__METHOD__, ['group' => $groupId, 'type' => $typeId, 'status' => $status]);
427 $return = $this->persistenceHandler->contentTypeHandler()->link($groupId, $typeId, $status);
428
429 if ($status === Type::STATUS_DEFINED) {
430 $this->cache->invalidateTags([
431 $this->cacheIdentifierGenerator->generateTag(self::TYPE_IDENTIFIER, [$typeId]),
432 ]);
433 // Clear loadContentTypes() cache as we effetely add an item to it's collection here.
434 $this->cache->deleteItems([
435 $this->cacheIdentifierGenerator->generateKey(
436 self::CONTENT_TYPE_LIST_BY_GROUP_IDENTIFIER,
437 [$groupId],
438 true
439 ),
440 ]);
441 }
442
443 return $return;
444 }
445
449 public function getFieldDefinition($id, $status)
450 {
451 $this->logger->logCall(__METHOD__, ['field' => $id, 'status' => $status]);
452
453 return $this->persistenceHandler->contentTypeHandler()->getFieldDefinition($id, $status);
454 }
455
459 public function getContentCount($contentTypeId)
460 {
461 $this->logger->logCall(__METHOD__, ['contentTypeId' => $contentTypeId]);
462
463 return $this->persistenceHandler->contentTypeHandler()->getContentCount($contentTypeId);
464 }
465
469 public function addFieldDefinition($typeId, $status, FieldDefinition $struct)
470 {
471 $this->logger->logCall(__METHOD__, ['type' => $typeId, 'status' => $status, 'struct' => $struct]);
472 $return = $this->persistenceHandler->contentTypeHandler()->addFieldDefinition(
473 $typeId,
474 $status,
475 $struct
476 );
477
478 if ($status === Type::STATUS_DEFINED) {
479 $this->cache->invalidateTags([
480 $this->cacheIdentifierGenerator->generateTag(self::TYPE_IDENTIFIER, [$typeId]),
481 $this->cacheIdentifierGenerator->generateTag(self::TYPE_MAP_IDENTIFIER),
482 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_FIELDS_TYPE_IDENTIFIER, [$typeId]),
483 ]);
484 }
485
486 return $return;
487 }
488
492 public function removeFieldDefinition($typeId, $status, $fieldDefinitionId)
493 {
494 $this->logger->logCall(__METHOD__, ['type' => $typeId, 'status' => $status, 'field' => $fieldDefinitionId]);
495 $this->persistenceHandler->contentTypeHandler()->removeFieldDefinition(
496 $typeId,
497 $status,
498 $fieldDefinitionId
499 );
500
501 if ($status === Type::STATUS_DEFINED) {
502 $this->cache->invalidateTags([
503 $this->cacheIdentifierGenerator->generateTag(self::TYPE_IDENTIFIER, [$typeId]),
504 $this->cacheIdentifierGenerator->generateTag(self::TYPE_MAP_IDENTIFIER),
505 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_FIELDS_TYPE_IDENTIFIER, [$typeId]),
506 ]);
507 }
508 }
509
513 public function updateFieldDefinition($typeId, $status, FieldDefinition $struct)
514 {
515 $this->logger->logCall(__METHOD__, ['type' => $typeId, 'status' => $status, 'struct' => $struct]);
516 $this->persistenceHandler->contentTypeHandler()->updateFieldDefinition(
517 $typeId,
518 $status,
519 $struct
520 );
521
522 if ($status === Type::STATUS_DEFINED) {
523 $this->cache->invalidateTags([
524 $this->cacheIdentifierGenerator->generateTag(self::TYPE_IDENTIFIER, [$typeId]),
525 $this->cacheIdentifierGenerator->generateTag(self::TYPE_MAP_IDENTIFIER),
526 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_FIELDS_TYPE_IDENTIFIER, [$typeId]),
527 ]);
528 }
529 }
530
534 public function publish($typeId)
535 {
536 $this->logger->logCall(__METHOD__, ['type' => $typeId]);
537 $this->persistenceHandler->contentTypeHandler()->publish($typeId);
538
539 // Clear type cache, map cache, and content cache which contains fields.
540 $this->cache->invalidateTags([
541 $this->cacheIdentifierGenerator->generateTag(self::TYPE_IDENTIFIER, [$typeId]),
542 $this->cacheIdentifierGenerator->generateTag(self::TYPE_MAP_IDENTIFIER),
543 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_FIELDS_TYPE_IDENTIFIER, [$typeId]),
544 ]);
545
546 // Clear Content Type Groups list cache
547 $contentType = $this->load($typeId);
548 $this->cache->deleteItems(
549 array_map(
550 function ($groupId) {
551 return $this->cacheIdentifierGenerator->generateKey(
552 self::CONTENT_TYPE_LIST_BY_GROUP_IDENTIFIER,
553 [$groupId],
554 true
555 );
556 },
557 $contentType->groupIds
558 )
559 );
560 }
561
565 public function getSearchableFieldMap()
566 {
567 return $this->getListCacheValue(
568 $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_FIELD_MAP_IDENTIFIER, [], true),
569 function () {
570 return $this->persistenceHandler->contentTypeHandler()->getSearchableFieldMap();
571 },
572 static function () {return [];},
573 static function () {return [];},
574 function () {
575 return [
576 $this->cacheIdentifierGenerator->generateTag(self::TYPE_MAP_IDENTIFIER),
577 ];
578 }
579 );
580 }
581
590 public function removeContentTypeTranslation(int $contentTypeId, string $languageCode): Type
591 {
592 $this->logger->logCall(__METHOD__, ['id' => $contentTypeId, 'languageCode' => $languageCode]);
593 $return = $this->persistenceHandler->contentTypeHandler()->removeContentTypeTranslation(
594 $contentTypeId,
595 $languageCode
596 );
597
598 $this->cache->invalidateTags([
599 $this->cacheIdentifierGenerator->generateTag(self::TYPE_IDENTIFIER, [$contentTypeId]),
600 $this->cacheIdentifierGenerator->generateTag(self::TYPE_MAP_IDENTIFIER),
601 $this->cacheIdentifierGenerator->generateTag(self::CONTENT_FIELDS_TYPE_IDENTIFIER, [$contentTypeId]),
602 ]);
603
604 return $return;
605 }
606
607 public function deleteByUserAndStatus(int $userId, int $status): void
608 {
609 $this->logger->logCall(__METHOD__, ['user' => $userId, 'status' => $status]);
610
611 $this->persistenceHandler->contentTypeHandler()->deleteByUserAndStatus($userId, $status);
612 if ($status === Type::STATUS_DEFINED) {
613 // As we don't have indication of affected type id's yet here, we need to clear all type cache for now.
614 $this->cache->invalidateTags([
615 $this->cacheIdentifierGenerator->generateTag(self::TYPE_WITHOUT_VALUE_IDENTIFIER),
616 ]);
617 }
618 }
619 }
eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler\getListCacheValue
getListCacheValue(string $key, callable $backendLoader, callable $cacheTagger, callable $cacheIndexes, callable $listTags=null, array $arguments=[])
Load list of objects of some type and loggs the hits / misses.
Definition: AbstractInMemoryHandler.php:127
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\ContentTypeHandler
ContentType cache.
Definition: ContentTypeHandler.php:25
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\CONTENT_TYPE_GROUP_IDENTIFIER
const CONTENT_TYPE_GROUP_IDENTIFIER
Definition: ContentTypeHandler.php:29
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\publish
publish($typeId)
{Update content objects.Updates content objects, depending on the changed field definitions....
Definition: ContentTypeHandler.php:534
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadGroup
loadGroup($groupId)
{}
Definition: ContentTypeHandler.php:151
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\updateGroup
updateGroup(GroupUpdateStruct $struct)
{}
Definition: ContentTypeHandler.php:115
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\copy
copy($userId, $typeId, $status)
{Copy a Type incl fields and group-relations from a given status to a new Type with status Type::STAT...
Definition: ContentTypeHandler.php:388
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadContentTypes
loadContentTypes($groupId, $status=Type::STATUS_DEFINED)
{One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED\eZ\Publish\SPI\Persistence\Cont...
Definition: ContentTypeHandler.php:215
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\BY_IDENTIFIER_SUFFIX
const BY_IDENTIFIER_SUFFIX
Definition: ContentTypeHandler.php:33
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\TYPE_IDENTIFIER
const TYPE_IDENTIFIER
Definition: ContentTypeHandler.php:26
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\unlink
unlink($groupId, $typeId, $status)
{Unlink a content type group from a content type.One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type:...
Definition: ContentTypeHandler.php:407
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadAllGroups
loadAllGroups()
{\eZ\Publish\SPI\Persistence\Content\Type\Group[]}
Definition: ContentTypeHandler.php:200
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\create
create(CreateStruct $struct)
{}
Definition: ContentTypeHandler.php:316
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\TYPE_MAP_IDENTIFIER
const TYPE_MAP_IDENTIFIER
Definition: ContentTypeHandler.php:36
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\$getGroupTags
$getGroupTags
Definition: ContentTypeHandler.php:42
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadGroups
loadGroups(array $groupIds)
{Return list of unique Content Type Groups, with group id as key.Missing items (NotFound) will be mis...
Definition: ContentTypeHandler.php:167
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\removeFieldDefinition
removeFieldDefinition($typeId, $status, $fieldDefinitionId)
{Removes a field definition from an existing Type.This method creates a new version of the Type with ...
Definition: ContentTypeHandler.php:492
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\CONTENT_TYPE_FIELD_MAP_IDENTIFIER
const CONTENT_TYPE_FIELD_MAP_IDENTIFIER
Definition: ContentTypeHandler.php:39
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\BY_REMOTE_SUFFIX
const BY_REMOTE_SUFFIX
Definition: ContentTypeHandler.php:35
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\createDraft
createDraft($modifierId, $typeId)
{Creates a draft of existing defined content type.Updates modified date, sets $modifierId and status ...
Definition: ContentTypeHandler.php:378
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\getSearchableFieldMap
getSearchableFieldMap()
{Returns content type, field definition and field type mapping information for search engine usage....
Definition: ContentTypeHandler.php:565
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\$getTypeKeys
$getTypeKeys
Definition: ContentTypeHandler.php:51
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\TYPE_GROUP_IDENTIFIER
const TYPE_GROUP_IDENTIFIER
Definition: ContentTypeHandler.php:27
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\$getTypeTags
$getTypeTags
Definition: ContentTypeHandler.php:48
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\createGroup
createGroup(GroupCreateStruct $struct)
{\eZ\Publish\SPI\Persistence\Content\Type\Group}
Definition: ContentTypeHandler.php:102
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\removeContentTypeTranslation
removeContentTypeTranslation(int $contentTypeId, string $languageCode)
Definition: ContentTypeHandler.php:590
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\getFieldDefinition
getFieldDefinition($id, $status)
{Returns field definition for the given field definition id.}
Definition: ContentTypeHandler.php:449
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadByIdentifier
loadByIdentifier($identifier)
{Loads a (defined) content type by identifier.Note: This method is responsible of having the Field De...
Definition: ContentTypeHandler.php:282
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\CONTENT_TYPE_IDENTIFIER
const CONTENT_TYPE_IDENTIFIER
Definition: ContentTypeHandler.php:28
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\$getGroupKeys
$getGroupKeys
Definition: ContentTypeHandler.php:45
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\init
init()
Set callback functions for use in cache retrival.
Definition: ContentTypeHandler.php:56
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadGroupByIdentifier
loadGroupByIdentifier($identifier)
{Loads Type Group by identifier.Legacy note: Uses name for identifier.}
Definition: ContentTypeHandler.php:183
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\CONTENT_TYPE_GROUP_WITH_BY_REMOTE_SUFFIX_IDENTIFIER
const CONTENT_TYPE_GROUP_WITH_BY_REMOTE_SUFFIX_IDENTIFIER
Definition: ContentTypeHandler.php:31
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadContentTypeList
loadContentTypeList(array $contentTypeIds)
Return list of unique Content Types, with type id as key.
Definition: ContentTypeHandler.php:240
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\load
load($typeId, $status=Type::STATUS_DEFINED)
{Loads a content type by id and status.Note: This method is responsible of having the Field Definitio...
Definition: ContentTypeHandler.php:256
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\getContentCount
getContentCount($contentTypeId)
{Counts the number of Content instances of the ContentType identified by given $contentTypeId....
Definition: ContentTypeHandler.php:459
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadByRemoteId
loadByRemoteId($remoteId)
{Loads a (defined) content type by remote id.Note: This method is responsible of having the Field Def...
Definition: ContentTypeHandler.php:299
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\deleteByUserAndStatus
deleteByUserAndStatus(int $userId, int $status)
Definition: ContentTypeHandler.php:607
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\update
update($typeId, $status, UpdateStruct $struct)
{One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED }
Definition: ContentTypeHandler.php:340
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\addFieldDefinition
addFieldDefinition($typeId, $status, FieldDefinition $struct)
{Adds a new field definition to an existing Type.This method creates a new version of the Type with t...
Definition: ContentTypeHandler.php:469
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\deleteGroup
deleteGroup($groupId)
{}
Definition: ContentTypeHandler.php:136
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\link
link($groupId, $typeId, $status)
{Link a content type group with a content type.One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::S...
Definition: ContentTypeHandler.php:424
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\updateFieldDefinition
updateFieldDefinition($typeId, $status, FieldDefinition $struct)
{This method updates the given $fieldDefinition on a Type.This method creates a new version of the Ty...
Definition: ContentTypeHandler.php:513
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\CONTENT_TYPE_GROUP_WITH_ID_SUFFIX_IDENTIFIER
const CONTENT_TYPE_GROUP_WITH_ID_SUFFIX_IDENTIFIER
Definition: ContentTypeHandler.php:30
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\CONTENT_TYPE_GROUP_LIST_IDENTIFIER
const CONTENT_TYPE_GROUP_LIST_IDENTIFIER
Definition: ContentTypeHandler.php:32
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\CONTENT_FIELDS_TYPE_IDENTIFIER
const CONTENT_FIELDS_TYPE_IDENTIFIER
Definition: ContentTypeHandler.php:37
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\TYPE_WITHOUT_VALUE_IDENTIFIER
const TYPE_WITHOUT_VALUE_IDENTIFIER
Definition: ContentTypeHandler.php:38
eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\CONTENT_TYPE_LIST_BY_GROUP_IDENTIFIER
const CONTENT_TYPE_LIST_BY_GROUP_IDENTIFIER
Definition: ContentTypeHandler.php:34
eZ\Publish\SPI\Persistence\Bookmark\CreateStruct
Definition: SPI/Persistence/Bookmark/CreateStruct.php:14
eZ\Publish\SPI\Persistence\Content\Location\UpdateStruct
Definition: Content/Location/UpdateStruct.php:12
eZ\Publish\SPI\Persistence\Content\Type\CreateStruct
Definition: SPI/Persistence/Content/Type/CreateStruct.php:13
eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition
Definition: SPI/Persistence/Content/Type/FieldDefinition.php:18
eZ\Publish\SPI\Persistence\Content\Type\Group\CreateStruct
Definition: SPI/Persistence/Content/Type/Group/CreateStruct.php:12
eZ\Publish\SPI\Persistence\Content\Type\Group\UpdateStruct
Definition: Content/Type/Group/UpdateStruct.php:12
eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct
Definition: Content/Type/UpdateStruct.php:12
eZ\Publish\SPI\Persistence\Content\Type
SPI Persistence Content\Type value object.
Definition: SPI/Persistence/Content/Type.php:15
eZ\Publish\SPI\Persistence\Content\Type\STATUS_DEFINED
const STATUS_DEFINED
Definition: SPI/Persistence/Content/Type.php:17
eZ\Publish\SPI\Persistence\Content\Type\Handler
Definition: SPI/Persistence/Content/Type/Handler.php:14
eZ\Publish\Core\Persistence\Cache
Definition: AbstractHandler.php:7
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+.