Elgg  Version 6.2
ResponseBuilder.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Http;
4 
7 
13 interface ResponseBuilder {
14 
22  public function setContent($content = '');
23 
28  public function getContent();
29 
37  public function setStatusCode(int $status_code);
38 
43  public function getStatusCode();
44 
52  public function setForwardURL(string $forward_url = REFERRER);
53 
58  public function getForwardURL(): ?string;
59 
66  public function setHeaders(array $headers = []);
67 
72  public function getHeaders();
73 
78  public function isInformational();
79 
84  public function isSuccessful();
85 
90  public function isRedirection();
91 
96  public function isClientError();
97 
102  public function isServerError();
103 
108  public function isOk();
109 
114  public function isNotModified();
115 
123  public function setException(\Exception $e);
124 
130  public function getException();
131 }
$content
Set robots.txt action.
Definition: set_robots.php:6
if(! $entity->delete(true, true)) $forward_url
Definition: delete.php:30
Exception thrown if an argument is not of the expected type.
Exception thrown to indicate range errors during program execution.
const REFERRER
Used in calls to forward() to specify the browser should be redirected to the referring page.
Definition: constants.php:37
HTTP response builder interface.
isRedirection()
Check if response is redirection.
setHeaders(array $headers=[])
Sets additional response headers.
isSuccessful()
Check if response is successful.
getContent()
Returns response body.
isInformational()
Check if response is informational.
getException()
Get the exception for this reponse.
getStatusCode()
Returns status code.
setException(\Exception $e)
Set an exception for this response.
isOk()
Check if response is OK.
setStatusCode(int $status_code)
Sets response HTTP status code.
setContent($content='')
Sets response body.
setForwardURL(string $forward_url=REFERRER)
Sets redirect URL.
getHeaders()
Returns additional response headers.
getForwardURL()
Returns redirect URL.
isNotModified()
Check if response has been modified.
isServerError()
Check if response is server error.
isClientError()
Check if response is client error.
$headers
Definition: section.php:21