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

Core/REST/Client/Output/ValueObjectVisitor/ObjectStateCreateStruct.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\REST\Client\Output\ValueObjectVisitor;
8
9 use eZ\Publish\Core\REST\Common\Output\ValueObjectVisitor;
10 use eZ\Publish\Core\REST\Common\Output\Generator;
11 use eZ\Publish\Core\REST\Common\Output\Visitor;
12
16 class ObjectStateCreateStruct extends ValueObjectVisitor
17 {
25 public function visit(Visitor $visitor, Generator $generator, $data)
26 {
27 $generator->startObjectElement('ObjectStateCreate');
28 $visitor->setHeader('Content-Type', $generator->getMediaType('ObjectStateCreate'));
29
30 $generator->startValueElement('identifier', $data->identifier);
31 $generator->endValueElement('identifier');
32
33 $generator->startValueElement('priority', $data->priority);
34 $generator->endValueElement('priority');
35
36 $generator->startValueElement('defaultLanguageCode', $data->defaultLanguageCode);
37 $generator->endValueElement('defaultLanguageCode');
38
39 $generator->startHashElement('names');
40
41 $generator->startList('value');
42 foreach ($data->names as $languageCode => $name) {
43 $generator->startValueElement('value', $name, array('languageCode' => $languageCode));
44 $generator->endValueElement('value');
45 }
46 $generator->endList('value');
47
48 $generator->endHashElement('names');
49
50 $generator->startHashElement('descriptions');
51
52 foreach ($data->descriptions as $languageCode => $description) {
53 $generator->startValueElement('value', $description, array('languageCode' => $languageCode));
54 $generator->endValueElement('value');
55 }
56
57 $generator->endHashElement('descriptions');
58
59 $generator->endObjectElement('ObjectStateCreate');
60 }
61 }
eZ\Publish\Core\REST\Client\Output\ValueObjectVisitor\ObjectStateCreateStruct
ObjectStateCreateStruct value object visitor.
Definition: Core/REST/Client/Output/ValueObjectVisitor/ObjectStateCreateStruct.php:17
eZ\Publish\Core\REST\Client\Output\ValueObjectVisitor\ObjectStateCreateStruct\visit
visit(Visitor $visitor, Generator $generator, $data)
Visit struct returned by controllers.
Definition: Core/REST/Client/Output/ValueObjectVisitor/ObjectStateCreateStruct.php:25
eZ\Publish\Core\REST\Common\Output\Generator
Output generator.
Definition: REST/Common/Output/Generator.php:13
eZ\Publish\Core\REST\Common\Output\ValueObjectVisitor
Basic ValueObjectVisitor.
Definition: ValueObjectVisitor.php:18
eZ\Publish\Core\REST\Common\Output\Visitor
Visits a value object into an HTTP Response.
Definition: Visitor.php:15
eZ\Publish\Core\REST\Common\Output\Visitor\setHeader
setHeader($name, $value)
Set HTTP response header.
Definition: Visitor.php:64
eZ\Publish\Core\REST\Client\Output\ValueObjectVisitor
Definition: Client/Output/ValueObjectVisitor/ContentObjectStates.php:7
eZ\Publish\Core\REST\Common\Output\ValueObjectVisitor
Definition: Common/Output/ValueObjectVisitor/ContentObjectStates.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.