Nextcloud PHP API (master)

DataResponse extends Response
in package

A generic DataResponse class that is used to return generic data responses for responders to transform

Tags
since
8.0.0
psalm-type

DataResponseType = array|int|float|string|bool|object|null|\stdClass|\JsonSerializable

template

S of int

template

H of array<string, mixed>

template-covariant

T of DataResponseType

template-extends

Response<int, array<string, mixed>>

Table of Contents

Properties

$data  : T
response data

Methods

__construct()  : mixed
getData()  : T
Used to get the set parameters
setData()  : DataResponse
Sets values in the data json array

Properties

Methods

__construct()

public __construct([T $data = [] ][, S $statusCode = Http::STATUS_OK ][, H $headers = [] ]) : mixed
Parameters
$data : T = []

the object or array that should be transformed

$statusCode : S = Http::STATUS_OK

the Http status code, defaults to 200

$headers : H = []

additional key value based headers

Tags
since
8.0.0

getData()

Used to get the set parameters

public getData() : T
Tags
since
8.0.0
Return values
T

the data

setData()

Sets values in the data json array

public setData(T $data) : DataResponse
Parameters
$data : T

an array or object which will be transformed

Tags
psalm-suppress

InvalidTemplateParam

since
8.0.0
Return values
DataResponse

Reference to this object


        
On this page

Search results