UploadResponse
in package
UploadResponses result from an upload request.
They carry information about problems concerning uploaded files.
Tags
Table of Contents
Constants
- STATUS_ERROR = 2
- Define the error status
- STATUS_INFO = 3
- Define the info status
- STATUS_OK = 0
- Define the normal status
- STATUS_WARNING = 1
- Define the warning status
Properties
- $logs : array<string|int, mixed>
- $statusTexts : array<string|int, mixed>
- $worstStatus : int
- The worstStatus is indentifying status of the upload files.
Methods
- __construct() : mixed
- addMessage() : mixed
- Adds a log message concerning a file to the response.
- getResponse() : array<string|int, mixed>
- get the response
- getWorstStatus() : int
- get the worst status
Constants
STATUS_ERROR
Define the error status
public
mixed
STATUS_ERROR
= 2
STATUS_INFO
Define the info status
public
mixed
STATUS_INFO
= 3
STATUS_OK
Define the normal status
public
mixed
STATUS_OK
= 0
STATUS_WARNING
Define the warning status
public
mixed
STATUS_WARNING
= 1
Properties
$logs
protected
array<string|int, mixed>
$logs
= array()
array( array( 'status' => 'ok'|'error'..., 'message' => string, 'file' => string ) )
$statusTexts
protected
array<string|int, mixed>
$statusTexts
= array(self::STATUS_OK => 'ok', self::STATUS_WARNING => 'warning', self::STATUS_ERROR => 'error', self::STATUS_INFO => 'info')
$worstStatus
The worstStatus is indentifying status of the upload files.
protected
int
$worstStatus
= 0
Methods
__construct()
public
__construct() : mixed
addMessage()
Adds a log message concerning a file to the response.
public
addMessage(string $status, string $message) : mixed
Parameters
- $status : string
-
one of UploadResponse::STATUS_(OK|WARNING|ERROR|INFO)
- $message : string
-
message
getResponse()
get the response
public
getResponse() : array<string|int, mixed>
Return values
array<string|int, mixed>getWorstStatus()
get the worst status
public
getWorstStatus() : int