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 Elgg\Http\DownloadResponse

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

Protected Attributes

 $content
 
int $status_code
 
string $forward_url = null
 
array $headers = []
 
Exception $exception = null
 
bool $secure_forward_url = true
 

Detailed Description

Response builder.

Since
4.0

Definition at line 14 of file Response.php.

Member Function Documentation

Elgg\Http\Response::getContent ( )

{Returns response body.

Returns
mixed
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 43 of file Response.php.

Elgg\Http\Response::getException ( )

{Get the exception for this reponse.

Returns
|null
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 58 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 92 of file Response.php.

Elgg\Http\Response::getHeaders ( )

{Returns additional response headers.

Returns
array
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 116 of file Response.php.

Elgg\Http\Response::getStatusCode ( )

{Returns status code.

Returns
int
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 77 of file Response.php.

Elgg\Http\Response::isClientError ( )

{Check if response is client error.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 151 of file Response.php.

Elgg\Http\Response::isInformational ( )

{Check if response is informational.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 123 of file Response.php.

Elgg\Http\Response::isNotModified ( )

{Check if response has been modified.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 165 of file Response.php.

Elgg\Http\Response::isOk ( )

{Check if response is OK.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 137 of file Response.php.

Elgg\Http\Response::isRedirection ( )

{Check if response is redirection.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 144 of file Response.php.

Elgg\Http\Response::isServerError ( )

{Check if response is server error.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 158 of file Response.php.

Elgg\Http\Response::isSuccessful ( )

{Check if response is successful.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 130 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 31 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 50 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 84 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 108 of file Response.php.

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

{Sets response HTTP status code.

Parameters
int$status_codeStatus code
Returns
self
Exceptions
RangeException
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 65 of file Response.php.

Member Data Documentation

Elgg\Http\Response::$content
protected

Definition at line 16 of file Response.php.

Exception Elgg\Http\Response::$exception = null
protected

Definition at line 24 of file Response.php.

string Elgg\Http\Response::$forward_url = null
protected

Definition at line 20 of file Response.php.

array Elgg\Http\Response::$headers = []
protected

Definition at line 22 of file Response.php.

bool Elgg\Http\Response::$secure_forward_url = true
protected

Definition at line 26 of file Response.php.

int Elgg\Http\Response::$status_code
protected

Definition at line 18 of file Response.php.


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