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

RestContentTypeBase.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor;
8
9 use eZ\Publish\Core\REST\Common\Output\ValueObjectVisitor;
10 use eZ\Publish\API\Repository\Values;
11
15 abstract class RestContentTypeBase extends ValueObjectVisitor
16 {
25 protected function getUrlTypeSuffix($contentTypeStatus)
26 {
27 switch ($contentTypeStatus) {
28 case Values\ContentType\ContentType::STATUS_DEFINED:
29 return '';
30
31 case Values\ContentType\ContentType::STATUS_DRAFT:
32 return 'Draft';
33
34 case Values\ContentType\ContentType::STATUS_MODIFIED:
35 return 'Modified';
36 }
37
38 return '';
39 }
40
48 protected function serializeStatus($contentTypeStatus)
49 {
50 switch ($contentTypeStatus) {
51 case Values\ContentType\ContentType::STATUS_DEFINED:
52 return 'DEFINED';
53
54 case Values\ContentType\ContentType::STATUS_DRAFT:
55 return 'DRAFT';
56
57 case Values\ContentType\ContentType::STATUS_MODIFIED:
58 return 'MODIFIED';
59 }
60
61 throw new \RuntimeException("Unknown content type status: '{$contentTypeStatus}'.");
62 }
63 }
eZ\Publish\Core\REST\Common\Output\ValueObjectVisitor
Basic ValueObjectVisitor.
Definition: ValueObjectVisitor.php:18
eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor\RestContentTypeBase
Base for RestContentType related value object visitors.
Definition: RestContentTypeBase.php:16
eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor\RestContentTypeBase\serializeStatus
serializeStatus($contentTypeStatus)
Serializes the given $contentTypeStatus to a string representation.
Definition: RestContentTypeBase.php:48
eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor\RestContentTypeBase\getUrlTypeSuffix
getUrlTypeSuffix($contentTypeStatus)
Returns a suffix for the URL type to generate on basis of the given $contentTypeStatus.
Definition: RestContentTypeBase.php:25
eZ\Publish\Core\REST\Common\Output\ValueObjectVisitor
Definition: Common/Output/ValueObjectVisitor/ContentObjectStates.php:7
eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor
Definition: Output/ValueObjectVisitor/BadRequestException.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.