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

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\REST\Common\Output\Generator Class Reference

Output generator. More...

Inheritance diagram for eZ\Publish\Core\REST\Common\Output\Generator:

## Public Member Functions
| setFormatOutput ($formatOutput)
| reset ()
| Reset output visitor to a virgin state. More...
| startDocument ($data)
| Start document. More...
| isEmpty ()
| Returns if the document is empty or already contains data. More...
| endDocument ($data)
| End document. More...
| startObjectElement ($name, $mediaTypeName=null)
| Start object element. More...
| endObjectElement ($name)
| End object element. More...
| startHashElement ($name)
| Start hash element. More...
| endHashElement ($name)
| End hash element. More...
| startValueElement ($name, $value)
| Start value element. More...
| endValueElement ($name)
| End value element. More...
| startList ($name)
| Start list. More...
| endList ($name)
| End list. More...
| startAttribute ($name, $value)
| Start attribute. More...
| endAttribute ($name)
| End attribute. More...
| getMediaType ($name)
| Get media type. More...
| generateFieldTypeHash ($hashElementName, $hashValue)
| Generates a generic representation of the scalar, hash or list given in $hashValue into the document, using an element of $hashElementName as its parent. More...
| serializeBool ($boolValue)
| Serializes a boolean value. More...

## Protected Member Functions
| checkStartDocument ($data)
| Check start document. More...
| checkEndDocument ($data)
| Check end document. More...
| checkStartObjectElement ($data)
| Check start object element. More...
| checkEndObjectElement ($data)
| Check end object element. More...
| checkStartHashElement ($data)
| Check start hash element. More...
| checkEndHashElement ($data)
| Check end hash element. More...
| checkStartValueElement ($data)
| Check start value element. More...
| checkEndValueElement ($data)
| Check end value element. More...
| checkStartList ($data)
| Check start list. More...
| checkEndList ($data)
| Check end list. More...
| checkStartAttribute ($data)
| Check start attribute. More...
| checkEndAttribute ($data)
| Check end attribute. More...
| generateMediaType ($name, $type)
| Generates a media type from $name and $type. More...
| generateMediaTypeWithVendor ($name, $type, $vendor='vnd.ez.api')
| Generates a media type from $name, $type and $vendor. More...
| checkStart ($type, $data, array $validParents)
| Check close / end operation. More...
| checkEnd ($type, $data)
| Check close / end operation. More...

## Protected Attributes
| $stack = []
| $formatOutput = false

## Detailed Description

Output generator.

Definition at line 12 of file REST/Common/Output/Generator.php.

## Member Function Documentation

## ◆ checkEnd()

eZ\Publish\Core\REST\Common\Output\Generator::checkEnd | ( |  | $type,
|  |  | $data
| ) |  |
| protected

Check close / end operation.

Parameters

  string | $type |
  mixed | $data |

Definition at line 378 of file REST/Common/Output/Generator.php.

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\checkEndAttribute(), eZ\Publish\Core\REST\Common\Output\Generator\checkEndDocument(), eZ\Publish\Core\REST\Common\Output\Generator\checkEndHashElement(), eZ\Publish\Core\REST\Common\Output\Generator\checkEndList(), eZ\Publish\Core\REST\Common\Output\Generator\checkEndObjectElement(), and eZ\Publish\Core\REST\Common\Output\Generator\checkEndValueElement().

## ◆ checkEndAttribute()

eZ\Publish\Core\REST\Common\Output\Generator::checkEndAttribute | ( |  | $data | ) |
| protected

Check end attribute.

Parameters

  mixed | $data |

Definition at line 286 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\checkEnd().

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Xml\endAttribute().

## ◆ checkEndDocument()

eZ\Publish\Core\REST\Common\Output\Generator::checkEndDocument | ( |  | $data | ) |
| protected

Check end document.

Parameters

  mixed | $data |

Definition at line 91 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\checkEnd().

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Json\endDocument(), and eZ\Publish\Core\REST\Common\Output\Generator\Xml\endDocument().

## ◆ checkEndHashElement()

eZ\Publish\Core\REST\Common\Output\Generator::checkEndHashElement | ( |  | $data | ) |
| protected

Check end hash element.

Parameters

  mixed | $data |

Definition at line 182 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\checkEnd().

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Json\endHashElement(), and eZ\Publish\Core\REST\Common\Output\Generator\Xml\endHashElement().

## ◆ checkEndList()

eZ\Publish\Core\REST\Common\Output\Generator::checkEndList | ( |  | $data | ) |
| protected

Check end list.

Parameters

  mixed | $data |

Definition at line 251 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\checkEnd().

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Xml\endList().

## ◆ checkEndObjectElement()

eZ\Publish\Core\REST\Common\Output\Generator::checkEndObjectElement | ( |  | $data | ) |
| protected

Check end object element.

Parameters

  mixed | $data |

Definition at line 137 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\checkEnd().

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Json\endObjectElement(), and eZ\Publish\Core\REST\Common\Output\Generator\Xml\endObjectElement().

## ◆ checkEndValueElement()

eZ\Publish\Core\REST\Common\Output\Generator::checkEndValueElement | ( |  | $data | ) |
| protected

Check end value element.

Parameters

  mixed | $data |

Definition at line 217 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\checkEnd().

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Xml\endValueElement().

## ◆ checkStart()

eZ\Publish\Core\REST\Common\Output\Generator::checkStart | ( |  | $type,
|  |  | $data,
|  | array | $validParents
| ) |  |
| protected

Check close / end operation.

Parameters

  string | $type |
  mixed | $data |
  array | $validParents |

Definition at line 346 of file REST/Common/Output/Generator.php.

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\checkStartAttribute(), eZ\Publish\Core\REST\Common\Output\Generator\checkStartHashElement(), eZ\Publish\Core\REST\Common\Output\Generator\checkStartList(), eZ\Publish\Core\REST\Common\Output\Generator\checkStartObjectElement(), and eZ\Publish\Core\REST\Common\Output\Generator\checkStartValueElement().

## ◆ checkStartAttribute()

eZ\Publish\Core\REST\Common\Output\Generator::checkStartAttribute | ( |  | $data | ) |
| protected

Check start attribute.

Parameters

  mixed | $data |

Definition at line 269 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\checkStart().

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Xml\startAttribute().

## ◆ checkStartDocument()

eZ\Publish\Core\REST\Common\Output\Generator::checkStartDocument | ( |  | $data | ) |
| protected

Check start document.

Parameters

  mixed | $data |

Definition at line 64 of file REST/Common/Output/Generator.php.

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Json\startDocument(), and eZ\Publish\Core\REST\Common\Output\Generator\Xml\startDocument().

## ◆ checkStartHashElement()

eZ\Publish\Core\REST\Common\Output\Generator::checkStartHashElement | ( |  | $data | ) |
| protected

Check start hash element.

Parameters

  mixed | $data |

Definition at line 154 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\checkStart().

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Json\startHashElement(), and eZ\Publish\Core\REST\Common\Output\Generator\Xml\startHashElement().

## ◆ checkStartList()

eZ\Publish\Core\REST\Common\Output\Generator::checkStartList | ( |  | $data | ) |
| protected

Check start list.

Parameters

  mixed | $data |

Definition at line 234 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\checkStart().

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Xml\startList().

## ◆ checkStartObjectElement()

eZ\Publish\Core\REST\Common\Output\Generator::checkStartObjectElement | ( |  | $data | ) |
| protected

Check start object element.

Parameters

  mixed | $data |

Definition at line 109 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\checkStart().

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Json\startObjectElement(), and eZ\Publish\Core\REST\Common\Output\Generator\Xml\startObjectElement().

## ◆ checkStartValueElement()

eZ\Publish\Core\REST\Common\Output\Generator::checkStartValueElement | ( |  | $data | ) |
| protected

Check start value element.

Parameters

  mixed | $data |

Definition at line 200 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\checkStart().

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Json\startValueElement(), and eZ\Publish\Core\REST\Common\Output\Generator\Xml\startValueElement().

## ◆ endAttribute()

eZ\Publish\Core\REST\Common\Output\Generator::endAttribute | ( |  | $name | ) |
| abstract

End attribute.

Parameters

  string | $name |

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ endDocument()

eZ\Publish\Core\REST\Common\Output\Generator::endDocument | ( |  | $data | ) |
| abstract

End document.

Returns the generated document as a string.

Parameters

  mixed | $data |

Returns
  string

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ endHashElement()

eZ\Publish\Core\REST\Common\Output\Generator::endHashElement | ( |  | $name | ) |
| abstract

End hash element.

Parameters

  string | $name |

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ endList()

eZ\Publish\Core\REST\Common\Output\Generator::endList | ( |  | $name | ) |
| abstract

End list.

Parameters

  string | $name |

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ endObjectElement()

eZ\Publish\Core\REST\Common\Output\Generator::endObjectElement | ( |  | $name | ) |
| abstract

End object element.

Parameters

  string | $name |

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ endValueElement()

eZ\Publish\Core\REST\Common\Output\Generator::endValueElement | ( |  | $name | ) |
| abstract

End value element.

Parameters

  string | $name |

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ generateFieldTypeHash()

eZ\Publish\Core\REST\Common\Output\Generator::generateFieldTypeHash | ( |  | $hashElementName,
|  |  | $hashValue
| ) |  |
| abstract

Generates a generic representation of the scalar, hash or list given in $hashValue into the document, using an element of $hashElementName as its parent.

Parameters

  string | $hashElementName |
  mixed | $hashValue |

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ generateMediaType()

eZ\Publish\Core\REST\Common\Output\Generator::generateMediaType | ( |  | $name,
|  |  | $type
| ) |  |
| protected

Generates a media type from $name and $type.

Deprecated:
  6.13.5 please start to use generateMediaTypeWithVendor()

Parameters

  string | $name |
  string | $type |

Returns
  string

Definition at line 310 of file REST/Common/Output/Generator.php.

## ◆ generateMediaTypeWithVendor()

eZ\Publish\Core\REST\Common\Output\Generator::generateMediaTypeWithVendor | ( |  | $name,
|  |  | $type,
|  |  | $vendor = `'vnd.ez.api'`
| ) |  |
| protected

Generates a media type from $name, $type and $vendor.

Parameters

  string | $name |
  string | $type |
  string | $vendor |

Returns
  string

Definition at line 324 of file REST/Common/Output/Generator.php.

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Xml\getMediaType().

## ◆ getMediaType()

eZ\Publish\Core\REST\Common\Output\Generator::getMediaType | ( |  | $name | ) |
| abstract

Get media type.

Parameters

  string | $name |

Returns
  string

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ isEmpty()

eZ\Publish\Core\REST\Common\Output\Generator::isEmpty | ( |  | ) |
| abstract

Returns if the document is empty or already contains data.

Returns
  bool

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\reset().

## ◆ reset()

eZ\Publish\Core\REST\Common\Output\Generator::reset | ( |  | ) |

Reset output visitor to a virgin state.

Definition at line 39 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\isEmpty().

## ◆ serializeBool()

eZ\Publish\Core\REST\Common\Output\Generator::serializeBool | ( |  | $boolValue | ) |
| abstract

Serializes a boolean value.

Parameters

  bool | $boolValue |

Returns
  mixed

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ setFormatOutput()

eZ\Publish\Core\REST\Common\Output\Generator::setFormatOutput | ( |  | $formatOutput | ) |

Definition at line 31 of file REST/Common/Output/Generator.php.

References eZ\Publish\Core\REST\Common\Output\Generator\$formatOutput.

## ◆ startAttribute()

eZ\Publish\Core\REST\Common\Output\Generator::startAttribute | ( |  | $name,
|  |  | $value
| ) |  |
| abstract

Start attribute.

Parameters

  string | $name |
  string | $value |

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ startDocument()

eZ\Publish\Core\REST\Common\Output\Generator::startDocument | ( |  | $data | ) |
| abstract

Start document.

Parameters

  mixed | $data |

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ startHashElement()

eZ\Publish\Core\REST\Common\Output\Generator::startHashElement | ( |  | $name | ) |
| abstract

Start hash element.

Parameters

  string | $name |

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ startList()

eZ\Publish\Core\REST\Common\Output\Generator::startList | ( |  | $name | ) |
| abstract

Start list.

Parameters

  string | $name |

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ startObjectElement()

eZ\Publish\Core\REST\Common\Output\Generator::startObjectElement | ( |  | $name,
|  |  | $mediaTypeName = `null`
| ) |  |
| abstract

Start object element.

Parameters

  string | $name |
  string | $mediaTypeName |

Reimplemented in eZ\Publish\Core\REST\Common\Output\Generator\Xml, and eZ\Publish\Core\REST\Common\Output\Generator\Json.

## ◆ startValueElement()

eZ\Publish\Core\REST\Common\Output\Generator::startValueElement | ( |  | $name,
|  |  | $value
| ) |  |
| abstract

Start value element.

Parameters

  string | $name |
  string | $value |

## Member Data Documentation

## ◆ $formatOutput

eZ\Publish\Core\REST\Common\Output\Generator::$formatOutput = false
| protected

Definition at line 29 of file REST/Common/Output/Generator.php.

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\setFormatOutput().

## ◆ $stack

eZ\Publish\Core\REST\Common\Output\Generator::$stack = []
| protected

Definition at line 22 of file REST/Common/Output/Generator.php.

The documentation for this class was generated from the following file:

- REST/Common/Output/Generator.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.