PHP Class RESTfulAPI_EmberDataDeSerializer

. JSON serialization and de-serialization
Author: Thierry Francois @colymba [email protected]
Inheritance: implements RESTfulAPI_DeSerializer
Afficher le fichier Open project: colymba/silverstripe-restfulapi

Méthodes publiques

Méthode Description
deserialize ( $json ) : array | false Convert client JSON data to an array of data ready to be consumed by SilverStripe
unformatName ( string $name ) : string Format a ClassName or Field name sent by client API to be used by SilverStripe

Méthodes protégées

Méthode Description
unformatPayloadData ( array $data ) : array Process payload data from client and unformats columns/values recursively

Private Methods

Méthode Description
deserializeColumnName ( string $name ) : string Format a DB Column name or Field name sent from client API to be used by SilverStripe

Method Details

deserialize() public méthode

Expects payload to be formatted: { "className": { "fieldName": "Field value", "relations": [1] } }
public deserialize ( $json ) : array | false
Résultat array | false Formatted array representation of the JSON data or false if failed

unformatName() public méthode

Format a ClassName or Field name sent by client API to be used by SilverStripe
public unformatName ( string $name ) : string
$name string ClassName of Field name
Résultat string Formatted name

unformatPayloadData() protected méthode

Process payload data from client and unformats columns/values recursively
protected unformatPayloadData ( array $data ) : array
$data array Payload data (decoded JSON)
Résultat array Paylaod data with all keys/values unformatted