* A helper class to validate and structure data for output according to the {@link http://slisweb.sjsu.edu/sl/index.php/Sloodle_communications_specification Sloodle communications specification}.
* Accessor function to set member value {@link $side_effects}. <b>Note:</b> it is recommended that you use {@link add_side_effect()} or {@link add_side_effects()} instead.
* @param mixed $par An integer side effect code, an array of integer side effect codes, or null to clear it
$this->_internal_validation_error("Sloodle - LSL response: cannot add side effects. Invalid element in array of side effect codes. All elements should be integers", 0);
$this->_internal_validation_error("Sloodle - LSL response: cannot add side effect. Invalid side effect type. should be an integer or an array of integers", 0);
}
// Was it valid?
if ($valid) {
// If we were passed just a single side effect, then convert it to an array
* Accessor function to set member value {@link $data}. <b>Note: it is recommended that you use the {@link add_data_line()} and {@link clear_data()} functions instead of this.</b>
* @param mixed $par Any scalar value, or a mixed array of scalars or scalar arrays, or NULL to clear it
* <i>Constructor</i> - can intialise some variables
* @param int $status_code The initial status code for the response (optional - ignore if NULL)
* @param string $status_descriptor The initial status descriptor for the response (optional - ignore if NULL)
* @param mixed $data The initial data for the response, which can be a scalar, or a mixed array of scalars/scalar-arrays (see {@link SloodleLSLResponse::$data}) (optional - ignore if NULL)
* @return void
* @access public
*/
function SloodleLSLResponse($status_code = NULL, $status_descriptor = NULL, $data = NULL)
// Can be called statically to allow simple output of basic data
// The status code is required, but the other parameters are optional
// If an error occurs, the LSL-friendly error message is output to the HTTP response, and the script terminated
// If $static is TRUE (default) then this will be treated as a static call, and a new response object will be used
// If $static is FALSE then this is treated as adding data to an existing response object
/**
* Quick output of data to avoid several accessor calls if the response is very basic.
* Can be called statically to allow simple output of basic data.
* The status code is required, but the other parameters are optional
* If an error occurs, the LSL-friendly error message is output to the HTTP response, and the script terminated
*
* @param int $status_code The status code for the response (required)
* @param string $status_descriptor The status descriptor for the response (optional - ignored if NULL)
* @param mixed $data The data for the response, which can be a scalar, or a mixed array of scalars/scalar-arrays (see {@link SloodleLSLResponse::$data}) (optional - ignored if NULL)
* @param bool $static If TRUE (default), then this function will assume it is being call statically, and construct its own response object. Otherwise, it will all the existing member data to render the output.
/// References to potentially external objects ///
/**
* The object used to output response data.
* The object reference may be provided externally in the parameters of the constructor ({@link SloodleLSLRequest()}) or via the ({@link set_response()}) accessor.
* Otherwise, it will have been instantiated by this object itself.
* The object used to store and process incoming user data.
* The object reference may be provided externally in the parameters of the constructor ({@link SloodleLSLRequest()}) or via the ({@link set_user()}) accessor.
* Otherwise, it will have been instantiated by this object itself.