Ubiquity 2.5.2
php rapid development framework
|
Base class for Formating Rest responses. More...
Public Member Functions | |
get ($objects, $pages=null) | |
Returns a formated JSON response for an array of objects $objects. | |
getDatas ($objects, &$classname=null) | |
Returns an array of datas from an array of objects. | |
getJSONDatas ($datas) | |
cleanRestObject ($o, &$classname=null) | |
Returns the array of attributes corresponding to an object $o. | |
getOne ($object) | |
Returns a formated JSON response for an object $object. | |
format ($arrayResponse) | |
Formats a response array. | |
getModel ($controllerName) | |
Returns the model name corresponding to $controlleName. | |
toJson ($data) | |
Formats an array of datas in JSON. | |
formatException ($e) | |
Returns a JSON representation of the exception $e. | |
Static Public Member Functions | |
static | toXML ($data, &$xml_data) |
Base class for Formating Rest responses.
Ubiquity\controllers\rest$ResponseFormatter This class is part of Ubiquity
Definition at line 17 of file ResponseFormatter.php.
cleanRestObject | ( | $o, | |
& | $classname = null |
||
) |
Returns the array of attributes corresponding to an object $o.
object | $o | |
string | $classname |
Reimplemented in JsonApiResponseFormatter.
Definition at line 56 of file ResponseFormatter.php.
format | ( | $arrayResponse | ) |
Formats a response array.
array | $arrayResponse |
Definition at line 89 of file ResponseFormatter.php.
formatException | ( | $e | ) |
Returns a JSON representation of the exception $e.
\Exception | $e |
Definition at line 127 of file ResponseFormatter.php.
get | ( | $objects, | |
$pages = null |
|||
) |
Returns a formated JSON response for an array of objects $objects.
array | $objects | |
array | null | $pages |
Reimplemented in JsonApiResponseFormatter.
Definition at line 26 of file ResponseFormatter.php.
getDatas | ( | $objects, | |
& | $classname = null |
||
) |
Returns an array of datas from an array of objects.
array | $objects | |
string | $classname |
Definition at line 38 of file ResponseFormatter.php.
getJSONDatas | ( | $datas | ) |
Definition at line 45 of file ResponseFormatter.php.
getModel | ( | $controllerName | ) |
Returns the model name corresponding to $controlleName.
string | $controllerName |
Definition at line 102 of file ResponseFormatter.php.
getOne | ( | $object | ) |
Returns a formated JSON response for an object $object.
object | $object |
Reimplemented in JsonApiResponseFormatter.
Definition at line 79 of file ResponseFormatter.php.
toJson | ( | $data | ) |
Formats an array of datas in JSON.
array | $data |
Definition at line 117 of file ResponseFormatter.php.
|
static |
Definition at line 132 of file ResponseFormatter.php.