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

Inheritance: extends eZ\Publish\Core\REST\Common\Output\Generator
Datei anzeigen Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$fieldTypeHashGenerator eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator Generator for field type hash values.
$isEmpty boolean Keeps track if the document is still empty.
$json array Data structure which is build during visiting;.

Public Methods

Method Description
__construct ( FieldTypeHashGenerator $fieldTypeHashGenerator )
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.
serializeBool ( boolean $boolValue ) : boolean Serializes a boolean value.
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, array $attributes = [] ) Start value element.

Protected Methods

Method Description
convertArrayObjects ( mixed $data ) : mixed Convert ArrayObjects to arrays.

Method Details

__construct() public method

public __construct ( FieldTypeHashGenerator $fieldTypeHashGenerator )
$fieldTypeHashGenerator eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator

convertArrayObjects() protected method

Recursively convert all ArrayObjects into arrays in the full data structure.
protected convertArrayObjects ( mixed $data ) : mixed
$data mixed
return mixed

endAttribute() public method

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

endDocument() public method

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

endHashElement() public method

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

endList() public method

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

endObjectElement() public method

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

endValueElement() public method

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

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

getMediaType() public method

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

isEmpty() public method

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

serializeBool() public method

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

startAttribute() public method

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

startDocument() public method

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

startHashElement() public method

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

startList() public method

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

startObjectElement() public method

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

startValueElement() public method

Start value element.
public startValueElement ( string $name, string $value, array $attributes = [] )
$name string
$value string
$attributes array

Property Details

$fieldTypeHashGenerator protected_oe property

Generator for field type hash values.
protected FieldTypeHashGenerator,eZ\Publish\Core\REST\Common\Output\Generator\Json $fieldTypeHashGenerator
return eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator

$isEmpty protected_oe property

Keeps track if the document is still empty.
protected bool $isEmpty
return boolean

$json protected_oe property

Data structure which is build during visiting;.
protected array $json
return array