Elgg  Version master
Public Member Functions | List of all members
Elgg\Http\ErrorResponse Class Reference

Error response builder. More...

Inheritance diagram for Elgg\Http\ErrorResponse:
Elgg\Http\Response Elgg\Http\ResponseBuilder

Public Member Functions

 __construct ($error= '', int $status_code=ELGG_HTTP_BAD_REQUEST, string $forward_url=REFERRER)
 Constructor. More...
 
- Public Member Functions inherited from Elgg\Http\Response
 setContent ($content= '')
 {Sets response body.
Parameters
mixed$contentContent of the response as a scalar value or an array
Returns
self
Exceptions
InvalidArgumentException
} More...
 
 getContent ()
 {Returns response body.
Returns
mixed
} More...
 
 setException (\Exception $e)
 {Set an exception for this response.
Parameters
\Exception$ethe exception for this response
Returns
self
} More...
 
 getException ()
 {Get the exception for this reponse.
Returns
|null
} More...
 
 setStatusCode (int $status_code)
 {Sets response HTTP status code.
Parameters
int$status_codeStatus code
Returns
self
Exceptions
RangeException
} More...
 
 getStatusCode ()
 {Returns status code.
Returns
int
} More...
 
 setForwardURL (string $forward_url=REFERRER)
 {Sets redirect URL.
Parameters
string$forward_urlForward URL
Returns
self
Exceptions
InvalidArgumentException
} More...
 
 getForwardURL ()
 {Returns redirect URL.
Returns
string|null string the forward url, null when no url was set or the constant REFERRER
} More...
 
 setHeaders (array $headers=[])
 {Sets additional response headers.
Parameters
array$headersHeaders
Returns
self
} More...
 
 getHeaders ()
 {Returns additional response headers.
Returns
array
} More...
 
 isInformational ()
 {Check if response is informational.
Returns
bool
} More...
 
 isSuccessful ()
 {Check if response is successful.
Returns
bool
} More...
 
 isOk ()
 {Check if response is OK.
Returns
bool
} More...
 
 isRedirection ()
 {Check if response is redirection.
Returns
bool
} More...
 
 isClientError ()
 {Check if response is client error.
Returns
bool
} More...
 
 isServerError ()
 {Check if response is server error.
Returns
bool
} More...
 
 isNotModified ()
 {Check if response has been modified.
Returns
bool
} More...
 

Additional Inherited Members

- Protected Attributes inherited from Elgg\Http\Response
 $content
 
int $status_code
 
string $forward_url = null
 
array $headers = []
 
Exception $exception = null
 
bool $secure_forward_url = true
 

Detailed Description

Error response builder.

Definition at line 8 of file ErrorResponse.php.

Constructor & Destructor Documentation

Elgg\Http\ErrorResponse::__construct (   $error = '',
int  $status_code = ELGG_HTTP_BAD_REQUEST,
string  $forward_url = REFERRER 
)

Constructor.

Parameters
mixed$errorError message / content
int$status_codeHTTP status code
string$forward_urlForward url
See also
elgg_error_response()

Definition at line 19 of file ErrorResponse.php.


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