PHP Интерфейс RESTfulAPI_Serializer

Автор: Thierry Francois @colymba [email protected]
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
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

Описание методов

formatName() публичный Метод

Format a SilverStripe ClassName of DBField to be used by the client API
public formatName ( string $name ) : string
$name string ClassName of DBField name
Результат string Formatted name

getcontentType() публичный Метод

Return Content-type header definition to be used in the API response
public getcontentType ( ) : string
Результат string Content-type

serialize() публичный Метод

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
Результат string JSON representation of data