class wsdata_simple_json_processor in Web Service Data 7
Hierarchy
- class \WsData
- class \wsdata_simple_json_processor
Expanded class hierarchy of wsdata_simple_json_processor
File
- ./
wsdata_simple_json.wsdata.processor.inc, line 3
View source
class wsdata_simple_json_processor extends WsData {
// Parse the web service response string, and returns a structured data array
public function parse($data) {
if (!isset($data) || empty($data)) {
return;
}
// Remove UTF-8 BOM if present, json_decode() does not like it.
if (substr($data, 0, 3) == pack("CCC", 0xef, 0xbb, 0xbf)) {
$data = substr($data, 3);
}
$data = trim($data);
return json_decode($data, TRUE);
}
function accepts() {
return array(
'json',
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
WsData:: |
public | property | ||
WsData:: |
protected | property | ||
WsData:: |
protected | property | ||
WsData:: |
public | function | Add data to an empty object or replace all existing data | |
WsData:: |
public | function | Retrieve the value for the given data key. | 1 |
WsData:: |
public | function | ||
WsData:: |
public | function | ||
wsdata_simple_json_processor:: |
function |
Overrides WsData:: |
||
wsdata_simple_json_processor:: |
public | function |
Overrides WsData:: |
1 |