PHP Класс Webiny\Component\Rest\Response\CallbackResult

Наследование: use trait Webiny\Component\Http\HttpTrait, use trait Webiny\Component\StdLib\StdLibTrait
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addDebugMessage ( string | array $message ) Adds a debug message to the debug output section.
addErrorMessage ( array $error ) Appends an error entry to the output.
attachDebugHeader ( string $name, string $value, boolean $ignoreEnv = false ) Adds a debug header information.
getData ( ) : mixed Returns the data from the service response.
getError ( ) : boolean | array If there are errors, error report array is returned, otherwise false.
getOutput ( ) : array Returns the output in form of an array.
sendOutput ( ) Sends the output to browser.
setData ( mixed $data ) Sets the callback content data.
setEnvToDevelopment ( ) Sets environment flag to development.
setErrorResponse ( string $message, string $description = '', string $code = '' ) Adds a general error to the response.
setExpiresIn ( integer $expiresIn ) Sets the cache control expiration time.
setHeaderResponse ( integer $statusCode, string $message = '' ) Set response header status code and message.

Описание методов

addDebugMessage() публичный Метод

Adds a debug message to the debug output section.
public addDebugMessage ( string | array $message )
$message string | array Debug message.

addErrorMessage() публичный Метод

Appends an error entry to the output.
public addErrorMessage ( array $error )
$error array Error data

attachDebugHeader() публичный Метод

Adds a debug header information.
public attachDebugHeader ( string $name, string $value, boolean $ignoreEnv = false )
$name string Header name.
$value string Header value.
$ignoreEnv boolean Headers will be added only if we are in development mode, unless you set this to true.

getData() публичный Метод

Returns the data from the service response.
public getData ( ) : mixed
Результат mixed

getError() публичный Метод

If there are errors, error report array is returned, otherwise false.
public getError ( ) : boolean | array
Результат boolean | array

getOutput() публичный Метод

Returns the output in form of an array.
public getOutput ( ) : array
Результат array

sendOutput() публичный Метод

Sends the output to browser.
public sendOutput ( )

setData() публичный Метод

Sets the callback content data.
public setData ( mixed $data )
$data mixed Data that will be set into output 'data' field.

setEnvToDevelopment() публичный Метод

Sets environment flag to development.
public setEnvToDevelopment ( )

setErrorResponse() публичный Метод

Adds a general error to the response.
public setErrorResponse ( string $message, string $description = '', string $code = '' )
$message string Error message.
$description string Error description.
$code string Error code.

setExpiresIn() публичный Метод

Sets the cache control expiration time.
public setExpiresIn ( integer $expiresIn )
$expiresIn integer

setHeaderResponse() публичный Метод

Set response header status code and message.
public setHeaderResponse ( integer $statusCode, string $message = '' )
$statusCode integer Response status code.
$message string Response message.