PHP Class Webiny\Component\Rest\Response\CallbackResult

Inheritance: use trait Webiny\Component\Http\HttpTrait, use trait Webiny\Component\StdLib\StdLibTrait
Afficher le fichier Open project: Webiny/Framework Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

addDebugMessage() public méthode

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

addErrorMessage() public méthode

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

attachDebugHeader() public méthode

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() public méthode

Returns the data from the service response.
public getData ( ) : mixed
Résultat mixed

getError() public méthode

If there are errors, error report array is returned, otherwise false.
public getError ( ) : boolean | array
Résultat boolean | array

getOutput() public méthode

Returns the output in form of an array.
public getOutput ( ) : array
Résultat array

sendOutput() public méthode

Sends the output to browser.
public sendOutput ( )

setData() public méthode

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

setEnvToDevelopment() public méthode

Sets environment flag to development.
public setEnvToDevelopment ( )

setErrorResponse() public méthode

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() public méthode

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

setHeaderResponse() public méthode

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