Output generator.
Properties
If set to true, output will be formatted and indented.
|
protected bool $formatOutput = false
|
Generator creation stack.
|
protected array<string|int, mixed> $stack = []
|
Use to check if it is OK to start / close the requested element in the
current state.
Methods
Generate attribute with given $name and $value.
|
public attribute(string $name, mixed $value) : void
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
$value
|
mixed
|
-
|
-
|
End attribute.
|
public abstract endAttribute(string $name) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
End document.
|
public abstract endDocument(mixed $data) : string
|
Returns the generated document as a string.
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Return values
string
End hash element.
|
public abstract endHashElement(string $name) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
End list.
|
public abstract endList(string $name) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
End object element.
|
public abstract endObjectElement(string $name) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
End value element.
|
public abstract endValueElement(string $name) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
Generates a generic representation of the scalar, hash or list given in
$hashValue into the document, using an element of $hashElementName as
its parent.
|
public abstract generateFieldTypeHash(string $hashElementName, mixed $hashValue) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$hashElementName
|
string
|
-
|
-
|
$hashValue
|
mixed
|
-
|
-
|
Get media type.
|
public abstract getMediaType(string $name) : string
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
Return values
string
Returns if the document is empty or already contains data.
|
public abstract isEmpty() : bool
|
Return values
bool
Reset output visitor to a virgin state.
Serializes a boolean value.
|
public abstract serializeBool(bool $boolValue) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$boolValue
|
bool
|
-
|
-
|
|
public setFormatOutput(mixed $formatOutput) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$formatOutput
|
mixed
|
-
|
-
|
Start attribute.
|
public abstract startAttribute(string $name, string $value) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
$value
|
string
|
-
|
-
|
Start document.
|
public abstract startDocument(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Start hash element.
|
public abstract startHashElement(string $name) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
Start list.
|
public abstract startList(string $name) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
Start object element.
|
public abstract startObjectElement(string $name[, string $mediaTypeName = null ]) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
$mediaTypeName
|
string
|
null
|
-
|
|
public abstract startValueElement(string $name, mixed $value[, array<string|int, mixed> $attributes = [] ]) : void
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
$value
|
mixed
|
-
|
-
|
$attributes
|
array<string|int, mixed>
|
[]
|
-
|
Generate value element with given $name and $value.
|
public valueElement(string $name, mixed $value) : void
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
$value
|
mixed
|
-
|
-
|
Check close / end operation.
|
protected checkEnd(string $type, mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$type
|
string
|
-
|
-
|
$data
|
mixed
|
-
|
-
|
Check end attribute.
|
protected checkEndAttribute(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Check end document.
|
protected checkEndDocument(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Check end hash element.
|
protected checkEndHashElement(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Check end list.
|
protected checkEndList(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Check end object element.
|
protected checkEndObjectElement(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Check end value element.
|
protected checkEndValueElement(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Check close / end operation.
|
protected checkStart(string $type, mixed $data, array<string|int, mixed> $validParents) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$type
|
string
|
-
|
-
|
$data
|
mixed
|
-
|
-
|
$validParents
|
array<string|int, mixed>
|
-
|
-
|
Check start attribute.
|
protected checkStartAttribute(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Check start document.
|
protected checkStartDocument(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Check start hash element.
|
protected checkStartHashElement(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Check start list.
|
protected checkStartList(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Check start object element.
|
protected checkStartObjectElement(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Check start value element.
|
protected checkStartValueElement(mixed $data) : mixed
|
Parameters
Name |
Type |
Default value |
Description |
$data
|
mixed
|
-
|
-
|
Generates a media type from $name and $type.
|
protected generateMediaType(string $name, string $type) : string
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
$type
|
string
|
-
|
-
|
Return values
string
Tags
-
Deprecated
-
6.13.5
please start to use generateMediaTypeWithVendor()
Generates a media type from $name, $type and $vendor.
|
protected generateMediaTypeWithVendor(string $name, string $type[, string $vendor = 'vnd.ibexa.api' ]) : string
|
Parameters
Name |
Type |
Default value |
Description |
$name
|
string
|
-
|
-
|
$type
|
string
|
-
|
-
|
$vendor
|
string
|
'vnd.ibexa.api'
|
-
|
Return values
string