public function deserialize($json)
    {
        $data = json_decode($json, true);

        //catch JSON parsing error
        $error = RESTfulAPIError::get_json_error();
        if ($error !== false) {
            return new RESTfulAPIError(400, $error);
        }

        if ($data) {
            $data = $this->unformatPayloadData($data);
        } else {
            return new RESTfulAPIError(400,
                "No data received."
            );
        }

        return $data;
    }
public function deserialize($json)
    {
        $data = json_decode($json, true);

        //catch JSON parsing error
        $error = RESTfulAPIError::get_json_error();
        if ($error !== false) {
            return new RESTfulAPIError(400, $error);
        }

        if ($data) {
            $data = $this->unformatPayloadData($data);
        } else {
            return new RESTfulAPIError(400,
                "No data received."
            );
        }

        return $data;
    }
public function deserialize ( $ json ) { $ data = json_decode ( $ json , true ) ; //catch JSON parsing error $ error = RESTfulAPIError :: get_json_error ( ) ; if ( $ error !== false ) { return new RESTfulAPIError ( 400 , $ error ) ; } if ( $ data ) { $ data = $ this -> unformatPayloadData ( $ data ) ; } else { return new RESTfulAPIError ( 400 , "No data received." ) ; } return $ data ; }
Convert client JSON data to an array of data
ready to be consumed by SilverStripe

Expects payload to be formatted:
{
"FieldName": "Field value",
"Relations": [1]
}

@param  string        $data   JSON to be converted to data ready to be consumed by SilverStripe
@return array|false           Formatted array representation of the JSON data or false if failed
Convert client JSON data to an array of data ready to be consumed by SilverStripe