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

Client/Output/ValueObjectVisitor/ViewInput.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\Generator;
10 use eZ\Publish\Core\REST\Common\Output\ValueObjectVisitor;
11 use eZ\Publish\Core\REST\Common\Output\Visitor;
12 use eZ\Publish\Core\Base\Exceptions;
13 use eZ\Publish\Core\REST\Server\Values\RestViewInput;
14
18 class ViewInput extends ValueObjectVisitor
19 {
26 public function visit(Visitor $visitor, Generator $generator, $data)
27 {
28 $generator->startObjectElement('ViewInput');
29
30 $generator->startValueElement('identifier', $data->identifier);
31 $generator->endValueElement('identifier');
32
33 if ($data->locationQuery !== null ) {
34 $queryElementName = 'locationQuery';
35 } elseif ($data->contentQuery !== null ) {
36 $queryElementName = 'contentQuery';
37 } else {
38 throw new Exceptions\InvalidArgumentException("ViewInput Query", "No content nor location query found in ViewInput");
39 }
40
41 $visitor->visitValueObject($data->$queryElementName);
42
43 $generator->endObjectElement('ViewInput');
44 }
45 }
eZ\Publish\Core\REST\Client\Exceptions\InvalidArgumentException
This exception is thrown if a service method is called with an illegal or non appropriate value.
Definition: Core/REST/Client/Exceptions/InvalidArgumentException.php:15
eZ\Publish\Core\REST\Client\Output\ValueObjectVisitor\ViewInput
ViewInput value object visitor.
Definition: Client/Output/ValueObjectVisitor/ViewInput.php:19
eZ\Publish\Core\REST\Client\Output\ValueObjectVisitor\ViewInput\visit
visit(Visitor $visitor, Generator $generator, $data)
Definition: Client/Output/ValueObjectVisitor/ViewInput.php:26
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\Server\Values\RestViewInput
RestContentCreateStruct view model.
Definition: RestViewInput.php:15
eZ\Publish\Core\Base\Exceptions
Definition: Core/Base/Exceptions/BadStateException.php:7
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+.