/** * Deserializes from JSON, validating the errors (will return an associative array * instead of objects) * * @param string $json * @return mixed */ public function fromJSON($json) { JSON::$useBuiltinEncoderDecoder = true; return JSON::decode($json); }
/** * Serialize to JSON, validating the errors * * @param mixed $data * @return string */ public function toJSON($data) { JSON::$useBuiltinEncoderDecoder = true; return JSON::encode($data); }