Elgg  Version master
Public Member Functions | Protected Attributes | List of all members
Elgg\Http\Response Class Reference

Response builder. More...

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

Public Member Functions

 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
InvalidArgumentException
} 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...
 

Protected Attributes

 $content
 
 $status_code
 
 $forward_url
 
 $headers
 
 $exception
 

Detailed Description

Response builder.

Since
4.0

Definition at line 13 of file Response.php.

Member Function Documentation

Elgg\Http\Response::getContent ( )

{Returns response body.

Returns
mixed
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 54 of file Response.php.

Elgg\Http\Response::getException ( )

Get the exception for this reponse.

Returns
|null

Implements Elgg\Http\ResponseBuilder.

Definition at line 69 of file Response.php.

Elgg\Http\Response::getForwardURL ( )

{Returns redirect URL.

Returns
string|null string the forward url, null when no url was set or the constant REFERRER
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 102 of file Response.php.

Elgg\Http\Response::getHeaders ( )

{Returns additional response headers.

Returns
array
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 117 of file Response.php.

Elgg\Http\Response::getStatusCode ( )

{Returns status code.

Returns
int
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 87 of file Response.php.

Elgg\Http\Response::isClientError ( )

{Check if response is client error.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 152 of file Response.php.

Elgg\Http\Response::isInformational ( )

{Check if response is informational.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 124 of file Response.php.

Elgg\Http\Response::isNotModified ( )

{Check if response has been modified.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 166 of file Response.php.

Elgg\Http\Response::isOk ( )

{Check if response is OK.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 138 of file Response.php.

Elgg\Http\Response::isRedirection ( )

{Check if response is redirection.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 145 of file Response.php.

Elgg\Http\Response::isServerError ( )

{Check if response is server error.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 159 of file Response.php.

Elgg\Http\Response::isSuccessful ( )

{Check if response is successful.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 131 of file Response.php.

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
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 43 of file Response.php.

Elgg\Http\Response::setException ( \Exception  $e)

Set an exception for this response.

Parameters
\Exception$ethe exception for this response
Returns
self

Implements Elgg\Http\ResponseBuilder.

Definition at line 61 of file Response.php.

Elgg\Http\Response::setForwardURL ( string  $forward_url = REFERRER)

{Sets redirect URL.

Parameters
string$forward_urlForward URL
Returns
self
Exceptions
InvalidArgumentException
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 94 of file Response.php.

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

{Sets additional response headers.

Parameters
array$headersHeaders
Returns
self
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 109 of file Response.php.

Elgg\Http\Response::setStatusCode ( int  $status_code)

{Sets response HTTP status code.

Parameters
int$status_codeStatus code
Returns
self
Exceptions
InvalidArgumentException
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 76 of file Response.php.

Member Data Documentation

Elgg\Http\Response::$content
protected

Definition at line 18 of file Response.php.

Elgg\Http\Response::$exception
protected

Definition at line 38 of file Response.php.

Elgg\Http\Response::$forward_url
protected

Definition at line 28 of file Response.php.

Elgg\Http\Response::$headers
protected

Definition at line 33 of file Response.php.

Elgg\Http\Response::$status_code
protected

Definition at line 23 of file Response.php.


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