Copied!

Generator

Generator.php : 12

Output generator.

Properties

protected $formatOutput

Generator.php : 29

If set to true, output will be formatted and indented.

protected bool $formatOutput = false

protected $stack

Generator.php : 22

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

publicattribute()

Generator.php : 272

Generate attribute with given $name and $value.

public attribute(string $name, mixed $value) : void

Parameters

Name Type Default value Description
$name string - -
$value mixed - -

publicendAttribute()

Generator.php : 301

End attribute.

public abstract endAttribute(string $name) : mixed

Parameters

Name Type Default value Description
$name string - -

publicendDocument()

Generator.php : 84

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

publicendHashElement()

Generator.php : 175

End hash element.

public abstract endHashElement(string $name) : mixed

Parameters

Name Type Default value Description
$name string - -

publicendList()

Generator.php : 254

End list.

public abstract endList(string $name) : mixed

Parameters

Name Type Default value Description
$name string - -

publicendObjectElement()

Generator.php : 130

End object element.

public abstract endObjectElement(string $name) : mixed

Parameters

Name Type Default value Description
$name string - -

publicendValueElement()

Generator.php : 220

End value element.

public abstract endValueElement(string $name) : mixed

Parameters

Name Type Default value Description
$name string - -

publicgenerateFieldTypeHash()

Generator.php : 359

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 - -

publicgetMediaType()

Generator.php : 320

Get media type.

public abstract getMediaType(string $name) : string

Parameters

Name Type Default value Description
$name string - -

Return values

string

publicisEmpty()

Generator.php : 57

Returns if the document is empty or already contains data.

public abstract isEmpty() : bool

Return values

bool

publicreset()

Generator.php : 39

Reset output visitor to a virgin state.

public reset() : mixed

publicserializeBool()

Generator.php : 432

Serializes a boolean value.

public abstract serializeBool(bool $boolValue) : mixed

Parameters

Name Type Default value Description
$boolValue bool - -

publicsetFormatOutput()

Generator.php : 31
public setFormatOutput(mixed $formatOutput) : mixed

Parameters

Name Type Default value Description
$formatOutput mixed - -

publicstartAttribute()

Generator.php : 284

Start attribute.

public abstract startAttribute(string $name, string $value) : mixed

Parameters

Name Type Default value Description
$name string - -
$value string - -

publicstartDocument()

Generator.php : 50

Start document.

public abstract startDocument(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

publicstartHashElement()

Generator.php : 147

Start hash element.

public abstract startHashElement(string $name) : mixed

Parameters

Name Type Default value Description
$name string - -

publicstartList()

Generator.php : 237

Start list.

public abstract startList(string $name) : mixed

Parameters

Name Type Default value Description
$name string - -

publicstartObjectElement()

Generator.php : 102

Start object element.

public abstract startObjectElement(string $name[, string $mediaTypeName = null ]) : mixed

Parameters

Name Type Default value Description
$name string - -
$mediaTypeName string null -

publicstartValueElement()

Generator.php : 203
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> [] -

publicvalueElement()

Generator.php : 193

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 - -

protectedcheckEnd()

Generator.php : 400

Check close / end operation.

protected checkEnd(string $type, mixed $data) : mixed

Parameters

Name Type Default value Description
$type string - -
$data mixed - -

protectedcheckEndAttribute()

Generator.php : 308

Check end attribute.

protected checkEndAttribute(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

protectedcheckEndDocument()

Generator.php : 91

Check end document.

protected checkEndDocument(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

protectedcheckEndHashElement()

Generator.php : 182

Check end hash element.

protected checkEndHashElement(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

protectedcheckEndList()

Generator.php : 261

Check end list.

protected checkEndList(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

protectedcheckEndObjectElement()

Generator.php : 137

Check end object element.

protected checkEndObjectElement(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

protectedcheckEndValueElement()

Generator.php : 227

Check end value element.

protected checkEndValueElement(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

protectedcheckStart()

Generator.php : 368

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> - -

protectedcheckStartAttribute()

Generator.php : 291

Check start attribute.

protected checkStartAttribute(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

protectedcheckStartDocument()

Generator.php : 64

Check start document.

protected checkStartDocument(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

protectedcheckStartHashElement()

Generator.php : 154

Check start hash element.

protected checkStartHashElement(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

protectedcheckStartList()

Generator.php : 244

Check start list.

protected checkStartList(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

protectedcheckStartObjectElement()

Generator.php : 109

Check start object element.

protected checkStartObjectElement(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

protectedcheckStartValueElement()

Generator.php : 210

Check start value element.

protected checkStartValueElement(mixed $data) : mixed

Parameters

Name Type Default value Description
$data mixed - -

protectedgenerateMediaType()

Generator.php : 332

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()

protectedgenerateMediaTypeWithVendor()

Generator.php : 346

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