PHP Class eZ\Publish\Core\REST\Common\Output\Generator

Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$formatOutput boolean If set to true, output will be formatted and indented.
$stack array Use to check if it is OK to start / close the requested element in the current state.

Public Methods

Method Description
endAttribute ( string $name ) End attribute.
endDocument ( mixed $data ) : string End document.
endHashElement ( string $name ) End hash element.
endList ( string $name ) End list.
endObjectElement ( string $name ) End object element.
endValueElement ( string $name ) End value element.
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.
getMediaType ( string $name ) : string Get media type.
isEmpty ( ) : boolean Returns if the document is empty or already contains data.
reset ( ) Reset output visitor to a virgin state.
serializeBool ( boolean $boolValue ) : mixed Serializes a boolean value.
setFormatOutput ( $formatOutput )
startAttribute ( string $name, string $value ) Start attribute.
startDocument ( mixed $data ) Start document.
startHashElement ( string $name ) Start hash element.
startList ( string $name ) Start list.
startObjectElement ( string $name, string $mediaTypeName = null ) Start object element.
startValueElement ( string $name, string $value ) Start value element.

Protected Methods

Method Description
checkEnd ( string $type, mixed $data ) Check close / end operation.
checkEndAttribute ( mixed $data ) Check end attribute.
checkEndDocument ( mixed $data ) Check end document.
checkEndHashElement ( mixed $data ) Check end hash element.
checkEndList ( mixed $data ) Check end list.
checkEndObjectElement ( mixed $data ) Check end object element.
checkEndValueElement ( mixed $data ) Check end value element.
checkStart ( string $type, mixed $data, array $validParents ) Check close / end operation.
checkStartAttribute ( mixed $data ) Check start attribute.
checkStartDocument ( mixed $data ) Check start document.
checkStartHashElement ( mixed $data ) Check start hash element.
checkStartList ( mixed $data ) Check start list.
checkStartObjectElement ( mixed $data ) Check start object element.
checkStartValueElement ( mixed $data ) Check start value element.
generateMediaType ( string $name, string $type ) : string Generates a media type from $name and $type.

Method Details

checkEnd() protected method

Check close / end operation.
protected checkEnd ( string $type, mixed $data )
$type string
$data mixed

checkEndAttribute() protected method

Check end attribute.
protected checkEndAttribute ( mixed $data )
$data mixed

checkEndDocument() protected method

Check end document.
protected checkEndDocument ( mixed $data )
$data mixed

checkEndHashElement() protected method

Check end hash element.
protected checkEndHashElement ( mixed $data )
$data mixed

checkEndList() protected method

Check end list.
protected checkEndList ( mixed $data )
$data mixed

checkEndObjectElement() protected method

Check end object element.
protected checkEndObjectElement ( mixed $data )
$data mixed

checkEndValueElement() protected method

Check end value element.
protected checkEndValueElement ( mixed $data )
$data mixed

checkStart() protected method

Check close / end operation.
protected checkStart ( string $type, mixed $data, array $validParents )
$type string
$data mixed
$validParents array

checkStartAttribute() protected method

Check start attribute.
protected checkStartAttribute ( mixed $data )
$data mixed

checkStartDocument() protected method

Check start document.
protected checkStartDocument ( mixed $data )
$data mixed

checkStartHashElement() protected method

Check start hash element.
protected checkStartHashElement ( mixed $data )
$data mixed

checkStartList() protected method

Check start list.
protected checkStartList ( mixed $data )
$data mixed

checkStartObjectElement() protected method

Check start object element.
protected checkStartObjectElement ( mixed $data )
$data mixed

checkStartValueElement() protected method

Check start value element.
protected checkStartValueElement ( mixed $data )
$data mixed

endAttribute() abstract public method

End attribute.
abstract public endAttribute ( string $name )
$name string

endDocument() abstract public method

Returns the generated document as a string.
abstract public endDocument ( mixed $data ) : string
$data mixed
return string

endHashElement() abstract public method

End hash element.
abstract public endHashElement ( string $name )
$name string

endList() abstract public method

End list.
abstract public endList ( string $name )
$name string

endObjectElement() abstract public method

End object element.
abstract public endObjectElement ( string $name )
$name string

endValueElement() abstract public method

End value element.
abstract public endValueElement ( string $name )
$name string

generateFieldTypeHash() abstract public method

Generates a generic representation of the scalar, hash or list given in $hashValue into the document, using an element of $hashElementName as its parent.
abstract public generateFieldTypeHash ( string $hashElementName, mixed $hashValue )
$hashElementName string
$hashValue mixed

generateMediaType() protected method

Generates a media type from $name and $type.
protected generateMediaType ( string $name, string $type ) : string
$name string
$type string
return string

getMediaType() abstract public method

Get media type.
abstract public getMediaType ( string $name ) : string
$name string
return string

isEmpty() abstract public method

Returns if the document is empty or already contains data.
abstract public isEmpty ( ) : boolean
return boolean

reset() public method

Reset output visitor to a virgin state.
public reset ( )

serializeBool() abstract public method

Serializes a boolean value.
abstract public serializeBool ( boolean $boolValue ) : mixed
$boolValue boolean
return mixed

setFormatOutput() public method

public setFormatOutput ( $formatOutput )

startAttribute() abstract public method

Start attribute.
abstract public startAttribute ( string $name, string $value )
$name string
$value string

startDocument() abstract public method

Start document.
abstract public startDocument ( mixed $data )
$data mixed

startHashElement() abstract public method

Start hash element.
abstract public startHashElement ( string $name )
$name string

startList() abstract public method

Start list.
abstract public startList ( string $name )
$name string

startObjectElement() abstract public method

Start object element.
abstract public startObjectElement ( string $name, string $mediaTypeName = null )
$name string
$mediaTypeName string

startValueElement() abstract public method

Start value element.
abstract public startValueElement ( string $name, string $value )
$name string
$value string

Property Details

$formatOutput protected property

If set to true, output will be formatted and indented.
protected bool $formatOutput
return boolean

$stack protected property

Use to check if it is OK to start / close the requested element in the current state.
protected array $stack
return array