Elgg  Version 4.x
ResponseBuilder.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Http;
4 
6 
12 interface ResponseBuilder {
13 
21  public function setContent($content = '');
22 
27  public function getContent();
28 
36  public function setStatusCode(int $status_code);
37 
42  public function getStatusCode();
43 
51  public function setForwardURL($forward_url = REFERRER);
52 
57  public function getForwardURL();
58 
65  public function setHeaders(array $headers = []);
66 
71  public function getHeaders();
72 
77  public function isInformational();
78 
83  public function isSuccessful();
84 
89  public function isRedirection();
90 
95  public function isClientError();
96 
101  public function isServerError();
102 
107  public function isOk();
108 
113  public function isNotModified();
114 
122  public function setException(\Exception $e);
123 
129  public function getException();
130 }
HTTP response builder interface.
if(!$entity->delete()) $forward_url
Definition: delete.php:30
getStatusCode()
Returns status code.
isRedirection()
Check if response is redirection.
getContent()
Returns response body.
isNotModified()
Check if response has been modified.
isOk()
Check if response is OK.
isInformational()
Check if response is informational.
isServerError()
Check if response is server error.
const REFERRER
Definition: constants.php:42
isSuccessful()
Check if response is successful.
setException(\Exception $e)
Set an exception for this response.
setStatusCode(int $status_code)
Sets response HTTP status code.
isClientError()
Check if response is client error.
setForwardURL($forward_url=REFERRER)
Sets redirect URL.
getException()
Get the exception for this reponse.
$content
Set robots.txt action.
Definition: set_robots.php:6
setHeaders(array $headers=[])
Sets additional response headers.
setContent($content= '')
Sets response body.
getHeaders()
Returns additional response headers.
getForwardURL()
Returns redirect URL.