Response Interface Reference

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

 setRequest (Request $request)
 
 getRequest ()
 
 setCacheId ($cacheId)
 
 getCacheId ()
 
 isCached ()
 
 getCacheDate ()
 
 setStatus ($status)
 
 getStatus ()
 
 setFile ($filename, $isDownload, $content='', $type='')
 
 getFile ()
 
- 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, $validateDesc=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 ()
 

Member Function Documentation

setRequest ( Request  $request)

Set the Request instance belonging to the response and vice versa.

Parameters
$requestRequest

Implemented in DefaultResponse.

getRequest ( )

Get the Request instance belonging to the response.

Returns
Request

Implemented in DefaultResponse.

setCacheId (   $cacheId)

Set a string value that uniquely identifies the request data resulting in 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.

isCached ( )

Check if the response is cached.

Controllers may use the result to determine if the controller logic must be executed or not.

Returns
Boolean

Implemented in DefaultResponse.

getCacheDate ( )

Get the caching date, if the response is cached.

Returns
DateTime or null, if not cached

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
Integer

Implemented in DefaultResponse.

setFile (   $filename,
  $isDownload,
  $content = '',
  $type = '' 
)

Set a file as response.

Parameters
$filenameThe name of the file, must be a real file, if no content is provided
$isDownloadBoolean, indicating whether the file should be return as download or not
$contentFile content, if in-memory only (optional)
$typeFile mime type, if in-memory only (optional)

Implemented in DefaultResponse.

getFile ( )

Get the file download.

Returns
Array with keys 'isDownload', 'filename', 'content' and 'type' or null

Implemented in DefaultResponse.