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

Afficher le fichier Open project: ezsystems/ezpublish-kernel Class Usage Examples

Méthodes publiques

Méthode Description
generateHashValue ( ArrayObject | Object $parent, string $hashElementName, mixed $hashValue ) Generates the field type value $hashValue as a child of the given Object using $hashElementName as the property name.

Méthodes protégées

Méthode Description
generateArrayValue ( ArrayObject | Object $parent, array $value ) : ArrayObject | Object Generates and returns a JSON structure (array or object) depending on $value type with $parent.
generateHashArray ( ArrayObject | Object $parent, array $hashArray ) : Object Generates a JSON object from the given $hashArray with $parent.
generateListArray ( ArrayObject | Object $parent, array $listArray ) : ArrayObject Generates a JSON array from the given $hashArray with $parent.
generateValue ( ArrayObject | Object $parent, mixed $value ) : mixed Generates and returns a value based on $hashValue type, with $parent ( if the type of $hashValue supports it).
isNumericArray ( array $value ) : boolean Checks if the given $value is a purely numeric array.

Method Details

generateArrayValue() protected méthode

If $type only contains numeric keys, the resulting structure will be an JSON array, otherwise a JSON object
protected generateArrayValue ( ArrayObject | Object $parent, array $value ) : ArrayObject | Object
$parent ArrayObject | Object
$value array
Résultat ArrayObject | Object

generateHashArray() protected méthode

Generates a JSON object from the given $hashArray with $parent.
protected generateHashArray ( ArrayObject | Object $parent, array $hashArray ) : Object
$parent ArrayObject | Object
$hashArray array
Résultat Object

generateHashValue() public méthode

Generates the field type value $hashValue as a child of the given Object using $hashElementName as the property name.
public generateHashValue ( ArrayObject | Object $parent, string $hashElementName, mixed $hashValue )
$parent ArrayObject | Object
$hashElementName string
$hashValue mixed

generateListArray() protected méthode

Generates a JSON array from the given $hashArray with $parent.
protected generateListArray ( ArrayObject | Object $parent, array $listArray ) : ArrayObject
$parent ArrayObject | Object
$listArray array
Résultat ArrayObject

generateValue() protected méthode

Generates and returns a value based on $hashValue type, with $parent ( if the type of $hashValue supports it).
protected generateValue ( ArrayObject | Object $parent, mixed $value ) : mixed
$parent ArrayObject | Object
$value mixed
Résultat mixed

isNumericArray() protected méthode

Checks if the given $value is a purely numeric array.
protected isNumericArray ( array $value ) : boolean
$value array
Résultat boolean