class JsonBuffer extends AbstractBuffer (View source)

The JsonBuffer class.

Properties

boolean $success Determines whether the request was successful from AbstractBuffer
string $message The main response message from AbstractBuffer
int $code Property code. from AbstractBuffer
mixed $data The response data from AbstractBuffer

Methods

__construct(string $message = null, mixed $data = null, bool $success = true, int $code = 200)

Constructor

string
toString()

Method for sending the response in JSON format

string
__toString()

__toString

string
getMimeType()

getMimeType

boolean
getSuccess()

Method to get property Success

setSuccess(boolean $success)

Method to set property success

string
getMessage()

Method to get property Message

setMessage(string $message)

Method to set property message

mixed
getData()

Method to get property Data

setData(mixed $data)

Method to set property data

int
getCode()

Method to get property Code

setCode(int $code)

Method to set property code

Details

__construct(string $message = null, mixed $data = null, bool $success = true, int $code = 200)

Constructor

Parameters

string $message
mixed $data
bool $success
int $code

at line line 23
string toString()

Method for sending the response in JSON format

Return Value

string

string __toString()

__toString

Return Value

string

at line line 33
string getMimeType()

getMimeType

Return Value

string

boolean getSuccess()

Method to get property Success

Return Value

boolean

AbstractBuffer setSuccess(boolean $success)

Method to set property success

Parameters

boolean $success

Return Value

AbstractBuffer Return self to support chaining.

string getMessage()

Method to get property Message

Return Value

string

AbstractBuffer setMessage(string $message)

Method to set property message

Parameters

string $message

Return Value

AbstractBuffer Return self to support chaining.

mixed getData()

Method to get property Data

Return Value

mixed

AbstractBuffer setData(mixed $data)

Method to set property data

Parameters

mixed $data

Return Value

AbstractBuffer Return self to support chaining.

int getCode()

Method to get property Code

Return Value

int

AbstractBuffer setCode(int $code)

Method to set property code

Parameters

int $code

Return Value

AbstractBuffer Return self to support chaining.