ContentJson extends Content
Class AnswerJson
Table of Contents
Constants
Methods
- __construct() : mixed
- Answer constructor.
- add() : mixed
- addError() : mixed
- addPermissionError() : mixed
- create() : mixed
- getErrorCollection() : ErrorCollection
- onFlush() : mixed
- On flush callback.
- set() : mixed
- toText() : string
Constants
TYPE_HTML
public
mixed
TYPE_HTML
= 'html'
TYPE_JSON
public
mixed
TYPE_JSON
= 'json'
Methods
__construct()
Answer constructor.
public
__construct(Response $response) : mixed
Parameters
- $response : Response
-
Response.
add()
public
add(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
addError()
public
addError(mixed $message[, null $code = null ]) : mixed
Parameters
- $message : mixed
- $code : null = null
addPermissionError()
public
addPermissionError([string|null $message = null ]) : mixed
Parameters
- $message : string|null = null
-
Message.
create()
public
static create(Response $response, mixed $type) : mixed
Parameters
- $response : Response
- $type : mixed
getErrorCollection()
public
getErrorCollection() : ErrorCollection
Return values
ErrorCollectiononFlush()
On flush callback.
public
onFlush() : mixed
set()
public
set(array<string|int, mixed> $parameters) : mixed
Parameters
- $parameters : array<string|int, mixed>
toText()
public
toText() : string