DataResponse

class OCP\AppFramework\Http\DataResponse
A generic DataResponse class that is used to return generic data responses
for responders to transform
Source:lib/public/AppFramework/Http/DataResponse.php#40
Parent:OCP\AppFramework\Http\Response

Properties

protected static property OCP\AppFramework\Http\DataResponse::$data
response data
Source:lib/public/AppFramework/Http/DataResponse.php#46
Type:array | int | float | string | bool | object

Methods

public OCP\AppFramework\Http\DataResponse::__construct($data=[], $statusCode=\OCP\AppFramework\Http::STATUS_OK, $headers=[])
Source:

lib/public/AppFramework/Http/DataResponse.php#55

Parameters:
  • $data (array | int | float | string | bool | object) the object or array that should be transformed
  • $statusCode (int) the Http status code, defaults to 200
  • $headers (array) additional key value based headers
Since:

8.0.0

public OCP\AppFramework\Http\DataResponse::setData($data)
Sets values in the data json array
Source:

lib/public/AppFramework/Http/DataResponse.php#71

Parameters:
  • $data (array | int | float | string | object) an array or object which will be transformed
Returns:

\OCP\AppFramework\Http\DataResponse Reference to this object

Since:

8.0.0

public OCP\AppFramework\Http\DataResponse::getData()
Used to get the set parameters
Source:lib/public/AppFramework/Http/DataResponse.php#83
Returns:array | int | float | string | bool | object the data
Since:8.0.0