PHP Interface RESTfulAPI_Serializer

Author: Thierry Francois @colymba [email protected]
Afficher le fichier Open project: colymba/silverstripe-restfulapi Interface Usage Examples

Méthodes publiques

Méthode Description
formatName ( string $name ) : string Format a SilverStripe ClassName of DBField to be used by the client API
getcontentType ( ) : string Return Content-type header definition to be used in the API response
serialize ( DataObject | DataList | Array $data ) : string Convert raw data (DataObject, DataList or Array) to JSON ready to be consumed by the client API

Method Details

formatName() public méthode

Format a SilverStripe ClassName of DBField to be used by the client API
public formatName ( string $name ) : string
$name string ClassName of DBField name
Résultat string Formatted name

getcontentType() public méthode

Return Content-type header definition to be used in the API response
public getcontentType ( ) : string
Résultat string Content-type

serialize() public méthode

Convert raw data (DataObject, DataList or Array) to JSON ready to be consumed by the client API
public serialize ( DataObject | DataList | Array $data ) : string
$data DataObject | DataList | Array data to serialize
Résultat string JSON representation of data