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

Response builder. More...

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

Public Member Functions

 __construct ($content= '', $status_code=ELGG_HTTP_OK, $forward_url=null)
 Constructor. More...
 
 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...
 
 setStatusCode ($status_code=ELGG_HTTP_OK)
 {Sets response HTTP status code.
Parameters
int$status_codeStatus code
Returns
self
Exceptions
InvalidArgumentException
} More...
 
 getStatusCode ()
 {Returns status code.
Returns
int
} More...
 
 setForwardURL ($forward_url=REFERRER)
 {Sets redirect URL.
Parameters
string$forward_urlForward URL
Returns
self
Exceptions
InvalidArgumentException
} More...
 
 getForwardURL ()
 {Returns redirect URL.
Returns
string|int|null string the forward url, null when no url was set or the constant REFERER
} 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
 

Detailed Description

Response builder.

Definition at line 10 of file OkResponse.php.

Constructor & Destructor Documentation

Elgg\Http\OkResponse::__construct (   $content = '',
  $status_code = ELGG_HTTP_OK,
  $forward_url = null 
)

Constructor.

Parameters
mixed$contentResponse data
int$status_codeHTTP status code
string$forward_urlForward URL
See also
elgg_ok_response()

Definition at line 41 of file OkResponse.php.

Member Function Documentation

Elgg\Http\OkResponse::getContent ( )

{Returns response body.

Returns
mixed
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 61 of file OkResponse.php.

Elgg\Http\OkResponse::getForwardURL ( )

{Returns redirect URL.

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

Implements Elgg\Http\ResponseBuilder.

Definition at line 97 of file OkResponse.php.

Elgg\Http\OkResponse::getHeaders ( )

{Returns additional response headers.

Returns
array
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 112 of file OkResponse.php.

Elgg\Http\OkResponse::getStatusCode ( )

{Returns status code.

Returns
int
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 79 of file OkResponse.php.

Elgg\Http\OkResponse::isClientError ( )

{Check if response is client error.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 147 of file OkResponse.php.

Elgg\Http\OkResponse::isInformational ( )

{Check if response is informational.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 119 of file OkResponse.php.

Elgg\Http\OkResponse::isNotModified ( )

{Check if response has been modified.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 161 of file OkResponse.php.

Elgg\Http\OkResponse::isOk ( )

{Check if response is OK.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 133 of file OkResponse.php.

Elgg\Http\OkResponse::isRedirection ( )

{Check if response is redirection.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 140 of file OkResponse.php.

Elgg\Http\OkResponse::isServerError ( )

{Check if response is server error.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 154 of file OkResponse.php.

Elgg\Http\OkResponse::isSuccessful ( )

{Check if response is successful.

Returns
bool
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 126 of file OkResponse.php.

Elgg\Http\OkResponse::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 50 of file OkResponse.php.

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

{Sets redirect URL.

Parameters
string$forward_urlForward URL
Returns
self
Exceptions
InvalidArgumentException
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 86 of file OkResponse.php.

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

{Sets additional response headers.

Parameters
array$headersHeaders
Returns
self
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 104 of file OkResponse.php.

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

{Sets response HTTP status code.

Parameters
int$status_codeStatus code
Returns
self
Exceptions
InvalidArgumentException
}

Implements Elgg\Http\ResponseBuilder.

Definition at line 68 of file OkResponse.php.

Member Data Documentation

Elgg\Http\OkResponse::$content
protected

Definition at line 15 of file OkResponse.php.

Elgg\Http\OkResponse::$forward_url
protected

Definition at line 25 of file OkResponse.php.

Elgg\Http\OkResponse::$headers
protected

Definition at line 30 of file OkResponse.php.

Elgg\Http\OkResponse::$status_code
protected

Definition at line 20 of file OkResponse.php.


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