You are here

protected function WsDataNode::parse in Web Service Data 7

Overrides WsData::parse

File

modules/ws_services/includes/WsDataNode.inc, line 9

Class

WsDataNode

Code

protected function parse($data) {
  $data = $this
    ->unwrap(json_decode($data));
  foreach ($data as $name => $value) {
    if (is_array($value)) {
      foreach ($data[$name] as $lang => $list) {
        if (is_array($list)) {
          foreach ($list as $id => $val) {
            if (is_array($val) and isset($val['value'])) {
              $data[$name][$lang][$id] = $val['value'];
            }
          }
        }
      }
    }
  }
  return $data;
}