Class

eZ\Publish\Core\REST\Common\Output\Generator\Json

class Json extends Generator

Json generator.

Methods

setFormatOutput($formatOutput)

from Generator
reset()

Reset output visitor to a virgin state.

from Generator
startDocument(mixed $data)

Start document.

bool isEmpty()

Returns if the document is empty or already contains data.

string endDocument(mixed $data)

End document.

startObjectElement(string $name, string $mediaTypeName = null)

Start object element.

endObjectElement(string $name)

End object element.

startHashElement(string $name)

Start hash element.

endHashElement(string $name)

End hash element.

startValueElement(string $name, string $value, array $attributes = array())

Start value element.

endValueElement(string $name)

End value element.

startList(string $name)

Start list.

endList(string $name)

End list.

startAttribute(string $name, string $value)

Start attribute.

endAttribute(string $name)

End attribute.

string getMediaType(string $name)

Get media type.

generateFieldTypeHash(string $hashElementName, mixed $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.

bool serializeBool(bool $boolValue)

Serializes a boolean value.

__construct(FieldTypeHashGenerator $fieldTypeHashGenerator)

Details

in Generator at line 33
public setFormatOutput($formatOutput)

Parameters

$formatOutput

in Generator at line 41
public reset()

Reset output visitor to a virgin state.

at line 52
public startDocument(mixed $data)

Start document.

Parameters

mixed $data

at line 66
public bool isEmpty()

Returns if the document is empty or already contains data.

Return Value

bool

at line 80
public string endDocument(mixed $data)

End document.

Returns the generated document as a string.

Parameters

mixed $data

Return Value

string

at line 128
public startObjectElement(string $name, string $mediaTypeName = null)

Start object element.

Parameters

string $name
string $mediaTypeName

at line 155
public endObjectElement(string $name)

End object element.

Parameters

string $name

at line 167
public startHashElement(string $name)

Start hash element.

Parameters

string $name

at line 189
public endHashElement(string $name)

End hash element.

Parameters

string $name

at line 203
public startValueElement(string $name, string $value, array $attributes = array())

Start value element.

Parameters

string $name
string $value
array $attributes

at line 231
public endValueElement(string $name)

End value element.

Parameters

string $name

at line 241
public startList(string $name)

Start list.

Parameters

string $name

at line 256
public endList(string $name)

End list.

Parameters

string $name

at line 269
public startAttribute(string $name, string $value)

Start attribute.

Parameters

string $name
string $value

at line 281
public endAttribute(string $name)

End attribute.

Parameters

string $name

at line 293
public string getMediaType(string $name)

Get media type.

Parameters

string $name

Return Value

string

at line 306
public generateFieldTypeHash(string $hashElementName, mixed $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.

Parameters

string $hashElementName
mixed $hashValue

at line 322
public bool serializeBool(bool $boolValue)

Serializes a boolean value.

Parameters

bool $boolValue

Return Value

bool

at line 42
public __construct(FieldTypeHashGenerator $fieldTypeHashGenerator)

Parameters

FieldTypeHashGenerator $fieldTypeHashGenerator