Elgg  Version 2.3
Public Member Functions | List of all members
Elgg\Http\ResponseBuilder Interface Reference

HTTP response builder interface. More...

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

Public Member Functions

 setContent ($content= '')
 Sets response body. More...
 
 getContent ()
 Returns response body. More...
 
 setStatusCode ($status_code=ELGG_HTTP_OK)
 Sets response HTTP status code. More...
 
 getStatusCode ()
 Returns status code. More...
 
 setForwardURL ($forward_url=REFERRER)
 Sets redirect URL. More...
 
 getForwardURL ()
 Returns redirect URL. More...
 
 setHeaders (array $headers=[])
 Sets additional response headers. More...
 
 getHeaders ()
 Returns additional response headers. More...
 
 isInformational ()
 Check if response is informational. More...
 
 isSuccessful ()
 Check if response is successful. More...
 
 isRedirection ()
 Check if response is redirection. More...
 
 isClientError ()
 Check if response is client error. More...
 
 isServerError ()
 Check if response is server error. More...
 
 isOk ()
 Check if response is OK. More...
 
 isNotModified ()
 Check if response has been modified. More...
 

Detailed Description

HTTP response builder interface.

private

Definition at line 12 of file ResponseBuilder.php.

Member Function Documentation

Elgg\Http\ResponseBuilder::getContent ( )

Returns response body.

Returns
mixed

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::getForwardURL ( )

Returns redirect URL.

Returns
string

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::getHeaders ( )

Returns additional response headers.

Returns
array

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::getStatusCode ( )

Returns status code.

Returns
int

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::isClientError ( )

Check if response is client error.

Returns
bool

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::isInformational ( )

Check if response is informational.

Returns
bool

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::isNotModified ( )

Check if response has been modified.

Returns
bool

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::isOk ( )

Check if response is OK.

Returns
bool

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::isRedirection ( )

Check if response is redirection.

Returns
bool

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::isServerError ( )

Check if response is server error.

Returns
bool

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::isSuccessful ( )

Check if response is successful.

Returns
bool

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::setContent (   $content = '')

Sets response body.

Parameters
mixed$contentContent of the response as a scalar value or an array
Returns
self
Exceptions
InvalidArgumentException

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::setForwardURL (   $forward_url = REFERRER)

Sets redirect URL.

Parameters
string$forward_urlForward URL
Returns
self
Exceptions
InvalidArgumentException

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::setHeaders ( array  $headers = [])

Sets additional response headers.

Parameters
array$headersHeaders
Returns
self

Implemented in Elgg\Http\OkResponse.

Elgg\Http\ResponseBuilder::setStatusCode (   $status_code = ELGG_HTTP_OK)

Sets response HTTP status code.

Parameters
int$status_codeStatus code
Returns
self
Exceptions
InvalidArgumentException

Implemented in Elgg\Http\OkResponse.


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