Bristol SU Support Package
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
BristolSU\Support\Action\ActionResponse Class Reference

Public Member Functions

 setMessage (string $message)
 
 getMessage ()
 
 setSuccess (bool $success)
 
 getSuccess ()
 

Static Public Member Functions

static success (string $message='')
 
static failure (string $message='')
 

Protected Attributes

 $success
 
 $message
 

Detailed Description

Definition at line 5 of file ActionResponse.php.

Member Function Documentation

◆ failure()

static BristolSU\Support\Action\ActionResponse::failure ( string  $message = '')
static

Create a failed response with an optional message

Parameters
string$messageOptional message
Returns
ActionResponse

Definition at line 77 of file ActionResponse.php.

References BristolSU\Support\Action\ActionResponse\$message, and BristolSU\Support\Action\ActionResponse\setSuccess().

Referenced by BristolSU\Support\Action\Contracts\Action\handle(), and BristolSU\Support\Action\Actions\Log\run().

◆ getMessage()

BristolSU\Support\Action\ActionResponse::getMessage ( )

Get the response message

Returns
string|null

Definition at line 33 of file ActionResponse.php.

References BristolSU\Support\Action\ActionResponse\$message.

Referenced by BristolSU\Support\Action\History\HasHistory\saveHistory().

◆ getSuccess()

BristolSU\Support\Action\ActionResponse::getSuccess ( )

Get if the action was successful

Returns
bool|null

Definition at line 52 of file ActionResponse.php.

References BristolSU\Support\Action\ActionResponse\$success.

Referenced by BristolSU\Support\Action\History\HasHistory\saveHistory().

◆ setMessage()

BristolSU\Support\Action\ActionResponse::setMessage ( string  $message)

Set the response message

Parameters
string$message

Definition at line 23 of file ActionResponse.php.

References BristolSU\Support\Action\ActionResponse\$message.

◆ setSuccess()

BristolSU\Support\Action\ActionResponse::setSuccess ( bool  $success)

◆ success()

static BristolSU\Support\Action\ActionResponse::success ( string  $message = '')
static

Create a successful response with an optional message

Parameters
string$messageOptional message
Returns
ActionResponse

Definition at line 63 of file ActionResponse.php.

References BristolSU\Support\Action\ActionResponse\$message, and BristolSU\Support\Action\ActionResponse\setSuccess().

Referenced by BristolSU\Support\Action\Actions\Log\run(), and BristolSU\Support\Action\ActionResponse\setSuccess().

Member Data Documentation

◆ $message

BristolSU\Support\Action\ActionResponse::$message
protected

◆ $success

BristolSU\Support\Action\ActionResponse::$success
protected

The documentation for this class was generated from the following file: