Detailed Description

Response holds the response values that are used as output from Controller instances.

It is typically instantiated by the ActionMapper instance and filled during Controller execution.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 20 of file Response.php.

+ Inheritance diagram for Response:

Public Member Functions

 setCacheId ($cacheId)
 
 getCacheId ()
 
 setStatus ($status)
 
 getStatus ()
 
 setFile ($filename, $content='')
 
 getFile ()
 
 setFinal ()
 
 isFinal ()
 
- Public Member Functions inherited from ControllerMessage
 setSender ($sender)
 
 getSender ()
 
 setContext ($context)
 
 getContext ()
 
 setAction ($action)
 
 getAction ()
 
 setFormat ($format)
 
 getFormat ()
 
 setHeader ($name, $value)
 
 setHeaders (array $headers)
 
 getHeader ($name, $default=null)
 
 getHeaders ()
 
 clearHeader ($name)
 
 clearHeaders ()
 
 hasHeader ($name)
 
 setValue ($name, $value)
 
 setValues (array $values)
 
 getValue ($name, $default=null, $filter=null, $options=null)
 
 getBooleanValue ($name, $default=false)
 
 getValues ()
 
 clearValue ($name)
 
 clearValues ()
 
 hasValue ($name)
 
 setProperty ($name, $value)
 
 getProperty ($name)
 
 addError (ApplicationError $error)
 
 setErrors (array $errors)
 
 getErrors ()
 
 clearErrors ()
 
 hasErrors ()
 

Public Attributes

const STATUS_200 = '200 OK'
 
const STATUS_201 = '201 Created'
 
const STATUS_202 = '202 Accepted'
 
const STATUS_204 = '204 No Content'
 
const STATUS_400 = '400 Bad Request'
 
const STATUS_404 = '404 Not Found'
 

Member Function Documentation

setCacheId (   $cacheId)

Set a string value that uniquely identifies the request data that cause the current response.

This value maybe used to compare two requests and return cached responses based on the result.

Parameters
$cacheId

Implemented in DefaultResponse.

getCacheId ( )

Get the cache id.

See also
Response::setCacheId()
Returns
The id

Implemented in DefaultResponse.

setStatus (   $status)

Set the response HTTP status code.

Parameters
$statusThe HTTP status code

Implemented in DefaultResponse.

getStatus ( )

Get the response HTTP status code.

Returns
String

Implemented in DefaultResponse.

setFile (   $filename,
  $content = '' 
)

Set a file download.

NOTE: This automatically sets the response to final (see Response::setFinal)

Parameters
$filenameThe name of the file, must be a real file, if no content is provided
$contentFile content, if in-memory only (optional)

Implemented in DefaultResponse.

getFile ( )

Get the file download.

Returns
Array with keys 'filename' and 'content' or null

Implemented in DefaultResponse.

setFinal ( )

Make sure there is no further processing after this response.

Implemented in DefaultResponse.

isFinal ( )

Check if the response forbids further processing or not.

Returns
Boolean

Implemented in DefaultResponse.

Member Data Documentation

const STATUS_200 = '200 OK'

Definition at line 22 of file Response.php.

const STATUS_201 = '201 Created'

Definition at line 23 of file Response.php.

const STATUS_202 = '202 Accepted'

Definition at line 24 of file Response.php.

const STATUS_204 = '204 No Content'

Definition at line 25 of file Response.php.

const STATUS_400 = '400 Bad Request'

Definition at line 27 of file Response.php.

const STATUS_404 = '404 Not Found'

Definition at line 28 of file Response.php.