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

Core/REST/Client/Output/ValueObjectVisitor/PolicyCreateStruct.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 PolicyCreateStruct extends ValueObjectVisitor
17 {
25 public function visit(Visitor $visitor, Generator $generator, $data)
26 {
27 $generator->startObjectElement('PolicyCreate');
28 $visitor->setHeader('Content-Type', $generator->getMediaType('PolicyCreate'));
29
30 $generator->startValueElement('module', $data->module);
31 $generator->endValueElement('module');
32
33 $generator->startValueElement('function', $data->function);
34 $generator->endValueElement('function');
35
36 $limitations = $data->getLimitations();
37 if (!empty($limitations)) {
38 $generator->startObjectElement('limitations');
39 $generator->startList('limitations');
40
41 foreach ($limitations as $limitation) {
42 $visitor->visitValueObject($limitation);
43 }
44
45 $generator->endList('limitations');
46 $generator->endObjectElement('limitations');
47 }
48
49 $generator->endObjectElement('PolicyCreate');
50 }
51 }
eZ\Publish\Core\REST\Client\Output\ValueObjectVisitor\PolicyCreateStruct
PolicyCreateStruct value object visitor.
Definition: Core/REST/Client/Output/ValueObjectVisitor/PolicyCreateStruct.php:17
eZ\Publish\Core\REST\Client\Output\ValueObjectVisitor\PolicyCreateStruct\visit
visit(Visitor $visitor, Generator $generator, $data)
Visit struct returned by controllers.
Definition: Core/REST/Client/Output/ValueObjectVisitor/PolicyCreateStruct.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\visitValueObject
visitValueObject($data)
Visit struct returned by controllers.
Definition: Visitor.php:131
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+.