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

Error response builder. More...

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

Public Member Functions

 __construct ($error= '', $status_code=ELGG_HTTP_BAD_REQUEST, $forward_url=REFERRER)
 Constructor. More...
 
- Public Member Functions inherited from Elgg\Http\OkResponse
 __construct ($content= '', $status_code=ELGG_HTTP_OK, $forward_url=null)
 Constructor. More...
 
 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...
 
 setStatusCode ($status_code=ELGG_HTTP_OK)
 {Sets response HTTP status code.
Parameters
int$status_codeStatus code
Returns
self
Exceptions
InvalidArgumentException
} More...
 
 getStatusCode ()
 {Returns status code.
Returns
int
} More...
 
 setForwardURL ($forward_url=REFERRER)
 {Sets redirect URL.
Parameters
string$forward_urlForward URL
Returns
self
Exceptions
InvalidArgumentException
} More...
 
 getForwardURL ()
 {Returns redirect URL.
Returns
string|int|null string the forward url, null when no url was set or the constant REFERER
} 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\OkResponse
 $content
 
 $status_code
 
 $forward_url
 
 $headers
 

Detailed Description

Error response builder.

Definition at line 8 of file ErrorResponse.php.

Constructor & Destructor Documentation

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

Constructor.

Parameters
string$errorError message
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: